1009 error "swf works fine" AS3
alt text http://www.ashcraftband.com/myspace/videodnd/board1.jpg
MY MOVIE WORKS, BUT I'M NOT SURE WHAT I BROKE. 1009 error says it "Cannot access a property. I'm using "if" conditions to trigger gotoAndPlay. What would be the best way to code this?
//Error #1009: Cannot access a property
stop();
//meter
var timer:Timer = new Timer(300);//1000 = 1 sec
timer.addEventListener(TimerEvent.TIMER, onTimer);
timer.start();
function onTimer(evt:TimerEvent):void {
watch.hand.rotation +=10;
//conditional argument to go to next stop-frame
if (w开发者_JAVA百科atch.hand.rotation >= 33) {
gotoAndPlay(2);
}
}
INSTANCES
watch, cycle, handalt text http://www.ashcraftband.com/myspace/videodnd/if.jpg
TIMELINE
alt text http://www.ashcraftband.com/myspace/videodnd/iftimeline_.jpgNOTE
"It's kind of like a preloader, just something I didn't understand"This error means that you are trying to reference something that isn't there yet. To fix just look at what you are trying to reference and ask yourself is it there yet.
Is this code in a class? If not, place it in a class.
If this code is in a frame then moving to a new frame would use the code from the new frame.
精彩评论