? Earlier 4 items total Later ?

On this page:?

SetTimeout : Flash

function testMe() {
 trace("callback: "+getTimer()+" ms.");
}

var intervalID:Number = setTimeout(testMe, 1000);

// clearTimeout(intervalID) // for clear the timeout

Dynamically placed buttons

It's simple, yet I often forget this.

var myMC:MovieClip;
var i = 1;
var pad = 5;
while (i<6) {
        trace(" i : "+i);
        myMC.duplicateMovieClip("myMC"+i, i);
        myMC.removeMovieClip();
        this["myMC"+i]._x = this["myMC"+(i-1)]._x+(this["myMC"+(i-1)]._width)+pad;
        this["myMC"+i].onRollOver = function() {
                trace(this);
        };
        i++;
}

Retreiving a Flash movie's domain name

Use the LocalConnection object to get the domain name of the server where the Flash movie is located.

var localDomainLC:LocalConneciton = new LocalConnection();
myDomainName = localDomainLC.domain();
trace( "My domain is " + myDomainName );



This will print out something like this:

My domain is example.com


Use Flash's MovieClipLoader Class

I'm always forgetting the syntax for this...

var oImgListener = new Object();
oImgListener.onLoadInit = function(target_mc)
{
     trace(target_mc._name + "  load complete");
     ...
}

var mclImg = new MovieClipLoader();
mclImg.addListener(oImgListener);
mclImg.loadClip("http://myurl.com/path/to/swf/or/jpg", mcImgLoader);

? Earlier 4 items total Later ?