views:

44

answers:

1

alt text

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 (watch.hand.rotation >= 33) {
gotoAndPlay(2);
}
}

INSTANCES
watch, cycle, hand

alt text

TIMELINE
alt text

NOTE
"It's kind of like a preloader, just something I didn't understand"

A: 

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.

Todd Moses