PDA

View Full Version : AS3 Rookie



Myazaki
May 29th, 2008, 09:43 AM
Hi!

I知 not new to AS2 but to AS3 I知 a complete rookie.

Attached are two versions of a menu that I developed. The AS2 Version is working great, but the AS3 is a disaster. If you test the movie you値l get this Output:


TypeError: Error #1010: A term is undefined and has no properties.
at AS3Menu_fla::MainTimeline/AS3Menu_fla::frame1()


Please help me understanding what am I doing wrong.:|

Iamthejuggler
May 29th, 2008, 10:19 AM
Change the for loop to:

for (var i:Number = 0; i<=aItemsMenu.length -1; i++)

it's trying to access a part of the array that doesn't exist.

Myazaki
May 29th, 2008, 10:48 AM
Thanks :) it worked :)

Now how do I make this part work.


function mouseEventClick(event:MouseEvent):void {
trace("Click Working");
this.gotoAndStop(2);
}

...this was so simple in AS2:| ...

Iamthejuggler
May 29th, 2008, 10:57 AM
That will work, it's just that you don't have a frame 2 on your timeline. :)

cloptic
May 29th, 2008, 11:13 AM
this.gotoAndStop(2);

"this" in your code is a relative reference to the main timeline.
you have to reference the instance name of the child mc.

Iamthejuggler
May 29th, 2008, 11:43 AM
Ah yeah, if you are trying to go to frame 2 of the menu items Cloptic is correct. I assumed you were trying to navigate around the root timeline.

Myazaki
May 29th, 2008, 12:02 PM
I thorgot that :|

Thaks!