开发者

package error in as3

开发者 https://www.devze.com 2023-01-04 19:39 出处:网络
package { import flash.display.Sprite; import flash.utils.*; public class SetTimeoutExample extends Sprite {
package {
import flash.display.Sprite;
import flash.utils.*;

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

    public functi开发者_运维技巧on 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


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消