Share Coding

Tutorials, Problems, Stuffs …

Category Archives: ActionScript

Flash error #1079 and #1065

Did you install new Flash SDK? Did your file show those error at run time?

VerifyError: Error #1079: 载入代码中不允许使用内置方法。

ReferenceError: Error #1065: 变量 Button 未定义。
ReferenceError: Error #1065: 变量 focusRectSkin 未定义。
ReferenceError: Error #1065: 变量 Button_upSkin 未定义。
ReferenceError: Error #1065: 变量 Button_selectedUpSkin 未定义。
ReferenceError: Error #1065: 变量 Button_selectedOverSkin 未定义。
ReferenceError: Error #1065: 变量 Button_selectedDownSkin 未定义。

ReferenceError: Error #1065: 变量 MainTimeline 未定义。

 
To solve this error, go to flash CS5/6 Edit-> Preferences-> Actionscript-> Language-> Actionscript3.0 settings
 

 
Move any playerglobal.swc or new source path you added in this few days from Library path to External library path.

Save and restart flash.

Advertisements

Peer To Peer Live Video Streaming on Actionscript 3.0 With OpenRTMFP/Cumulus Server

To read this post, you need to finish H.264 Live Streaming first and know how to have a live streaming in Actionscript 3.0.
The target is to have a high quality(H.264) and high performance(Peer to peer) Web meeting.
This post only contain actionscript code at publisher and player. You must set up a OpenRTMFP/Cumulus Server.

Follow this post https://sharecoding.wordpress.com/2012/05/22/install-openrtmfpcumulus-to-centos-6-2/ to start a server and use this post to modify your H.264 Live Streaming project.

Web Meeting Publisher & Player

import flash.net.NetGroup;

 

var userid:String;
var groupname:String;

// Receive Flash Parameters from web page
userid = LoaderInfo(this.root.loaderInfo).parameters["userid"];
groupname = LoaderInfo(this.root.loaderInfo).parameters["groupname"];
if (userid==""||userid==null) {
	userid = "456";
}
if (groupname==""||groupname==null) {
	groupname = "swfever";
}

 
Read more of this post

Install OpenRTMFP/Cumulus to CentOS 6.2

CumulusServer is a complete open source and cross-platform RTMFP server extensible by way of scripting.

From: Cumulus

RTMFP is a peer-to-peer system.
RTMFP will reduce the bandwidth costs for direct, live, real‐time communication solutions.
Flows data between the end‐user clients and not the server, bandwidth is not being used at the server.

From: Wikipedia

 
We are using OpenRTMFP and not Adobe FMS is because it is open source and do not cost any money.
Notes: Flash Media Streaming Server DO NOT support RTMFP.

Read more of this post

H.264 Live Video Streaming on Actionscript 3.0 with Red5 Server

**A suggestion for you**: do not try to use flash streaming as a stable long term video publishing channel.

1. Import

import flash.media.H264VideoStreamSettings;
import flash.media.VideoStreamSettings;
import flash.media.H264Level;
import flash.media.H264Profile;

2. Variable and setting

var cam:Camera;
var camBandWidth:Number = 0;
var camQualityPersentage:Number = 90;
var camFPS:Number = 15;
var camKeyFrameInterval:Number = 35;
var camWidth:Number = 240;
var camHeight:Number = 220;

var h264Settings:H264VideoStreamSettings;

Read more of this post

jQuery Call Flash or Flash Call JavaScript

Click here for Demo

This time we need jQuery library and two plugins: EXTERNALINTERFACE and swfObject

<script type="text/javascript" src="http://www.davecomeau.net/javascript/jquery/jquery-1.3.2.js"></script>
<script type="text/javascript" src="http://www.davecomeau.net/javascript/jquery/jquery.externalinterface.js"></script>
<script type="text/javascript" src="http://www.davecomeau.net/javascript/swfobject/swfobject.js"></script>

Read more of this post