Development Blog by Professionals
Flash
You Tube Flash AS3 / AS2 Data & Player API
Jul 12th
Recently I have been working on something involving the use of video content from You Tube. With the lack of a good API out there I created my own. Below is a simple example of this working with sample code to download further below.
Control Flash from Javascript
Jun 17th
Receiving data from a Flash movie:
- Enter some text in the Flash movie’s Data field, then press Receive Data. The data from the Flash movie is then transferred to the html form. More >
Flash AS2 XML to Array
Jun 8th
var xmlDoc:XML = new XML();
System.useCodepage = true;
xmlDoc.ignoreWhite = true;xmlDoc.onLoad = function(ok:Boolean) {
if (ok) {
doMenu(this);
} else {
trace(“XML did not load”);
}
};xmlDoc.load(“myImages.xml”);
function doMenu(xml:XML) {
var num:Number = xml.firstChild.childNodes.length;
pics = new Array();
for (var i = 0; i < num; i++) {
pics[i] = xml.firstChild.childNodes[i].attributes.image;
}
trace(pics);
}
Tweener and “256 levels of recursion were exceeded in one action list”
Jun 4th
Tweeners’ great, but I came across one little problem the other day: when I tried to remove an externally loaded swf from the stage while it was mid-animation, Tweener could bring the whole Flash movie to a halt with the error ‘256 levels of recursion were exceeded in one action list’.
Obviously that’s bad – because this particular error completely stops the flash player with no warning to the end user. And the fact that external content – which I have no control over – can cause this is doubly bad.
All is not lost however, because Tweener has a useful little function:Tweener.removeAllTweens(); ok, so it can interfere with everything on your flash movie as well, but at least it’s stopping the recursion errors.
So, if you try to remove a loaded swf file with .removeMovieClip(), you might find that it’s using Tweener. And if so, call Tweener.removeAllTweens() before you call .removeMovieClip() and you’ll be fine. Phew! case closed.
http://hosted.zeh.com.br/tweener/docs/en-us/
Resources;
Preloading External Images in Flash Using the MovieClipLoader Class
Jun 3rd
Preloading External Images in Flash Using the MovieClipLoader Class
The MovieClipLoader class is an ActionScript tool for loading external content such as images and Flash movies into another Flash movie. Other ways for doing this same thing is the Loader Component and the old .loadMovie() method. The MovieClipLoader class is better than those other two methods because of its flexibility and advanced options for tracking the progress of your downloaded objects. This tutorial will teach you the basics on how to use the MovieClipLoader class to load an external image in Flash at run time. You are assumed to have a beginner knowledge of ActionScript in order to follow this tutorial. More >
AS2 tween – tweener how to intercept when the tween is finished
Jun 2nd
Sometimes, it is needed to know when the tween animation that we have applied to a MovieClip is finished.
This way, we can call other functions and carry out other codes in our Flash project.
To intercept the event that is initiated by Tweener at the end of the animation, we need to pass a parameter named onComplete to the method addTween the following way:
import caurina.transitions.Tweener;
Tweener.addTween(clip_mc,{x:500,time:1,transition:"easeOutBounce",onComplete:ItsDone});
Together with onComplete, I pass the name of the function that I want to be carried out at the end of the tween (in this case, I named it ItsDone).
fscommand(“quit”) in AS3
Jun 2nd
function clickHandler(event:MouseEvent):void {
fscommand(“quit”);
}
fscommand(“fullscreen”,”true”);” error AS3
Jun 2nd
import flash.display.StageDisplayState; stage.displayState = StageDisplayState.FULL_SCREEN;
AS3 – stage.scaleMode
Jun 2nd
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT
Flash AS3 Typewriter Effect
May 28th
1. Place a TextField on frame 1 and set the instance name to textbox
2. Enter the following code into frame 1 More >


