setTimeout in Flash 8

to call a function just once

(FUNCTION scoped to an instance of a class) :

var john = new Person();
setTimeout(john.doThis, 3000, “marty”, “eat lunch”, “10 a.m.”);

(or use this inline style:

_global[‘setTimeout’](
function(v:String)
{
trace(“helloworld!!!”+v);},
1000,
“this is a test”
);

it’s pretty much useless since I could not find a way to refer to the current object in the inline function.
)

(FUNCTION scoped in a movieclip):

setTimeout(sub_painting_nav_mc, “doIn”, INTIMEOUT);

to use setTimeout inside a class:

_global[‘setTimeout’](this,’showPopup’,1000);

Or,

edit toplevel.as
(C:\Program Files\Macromedia\Flash 8\en\First Run\Classes on my computer)
and add two lines
intrinsic function clearTimeout(id:Number):Void;
intrinsic function setTimeout():Number;

before #endinitclip directive

Here.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: