views:

43

answers:

1
package {
import flash.display.Sprite;
import flash.utils.*;

public class SetTimeoutExample extends Sprite {
    private var delay:Number = 1000; // delay before calling myDelayedFunction

    public function SetTimeoutExample() {
        var intervalId:uint = setTimeout(myDelayedFunction, delay, "Hello", "World");
    }

    public function myDelayedFunction():void {
        trace(arguments[0] + " " + arguments[1]);
    }
}
}

i take an error about package what is wrong in this code?thanks

+3  A: 

You need to create a new file called SetTimeoutExample.as, and put the code in there. Make sure that the file is in the same directory as player.fla. Then open player.fla, and in the properties window (Window > Properties), set the "Class" field to SetTimeoutExample (without the .as).

Alex Miller
thanks very much but now i get a new error 1180:Call to a possibly undefined method addFrameScript.
merve_89