PDA

View Full Version : HELP!add parent?



yuzhan618
July 31st, 2008, 01:06 AM
hi, i have a button allzones inside movieclip1 at one timeline, when i click on this button ,

i want goto frame 2 inside movieclip2 at another timeline.

how can i add parent to this button?
thanks!!

the code now i have:
function zone(e:Event){
gotoAndStop(2);
}
allzones.addEventListener(MouseEvent.CLICK,zone);

Felixz
July 31st, 2008, 06:46 AM
function zone(event:Event){
event.currentTarget.parent.gotoAndStop(2);
}
allzones.addEventListener(MouseEvent.CLICK,zone);

yuzhan618
July 31st, 2008, 10:12 AM
thanks
i put the code at the button layer, but there is an error
"access of undefined property event"

...?

Felixz
July 31st, 2008, 12:55 PM
you haven't copied all...

zone(event:Event){ ...
zone(e:Event){ ...