Saturday, April 7, 2007

Code To Load The External SWF File

Since our project will be done totally in Flash and there're a lot of swf movies and stuff, we should think about a better way to manage all the files properly. It's hard to mix all the swf together, I've found the below coding to combine all the small swf files:

var mcl:MovieClipLoader = new MovieClipLoader();

var mclL:Object = new Object();

mclL.onLoadInit = function() {
loader._visible = false;
loader.percent.text = "";
}

mcl.addListener(mclL);

mcl.loadClip("swf1.swf",holder);

Using CSS Style in Flash

The below coding is used for using CSS style in Flash. Instead of having a large block of text using the same font, color, and style, we can easily use CSS to define custom text properties without having to break our text into multiple text fields.