gotoAndStop.parent("home") AS3 ?


#1

hi everyone thanks for looking at this I need some help it should be simple I hope.

I am inside a movie clip on the main timeline in a AS3 project and I run my animation on the click of a button, once the animation is done I need code on the last frame that says go to frame label “home” that is in the parent timeline of the movie clip I am in or the root.

in AS2 I simply used the code below on the last frame of the animation

_parent.gotoAndStop(“home”);


#2
hi everyone thanks for looking at this I need some help it should be simple I hope.

I am inside a movie clip on the main timeline in a AS3 project and I run my animation on the click of a button, once the animation is done I need code on the last frame that says go to frame label “home” that is in the parent timeline of the movie clip I am in or the root.

in AS2 I simply used the code below on the last frame of the animation

_parent.gotoAndStop(“home”);


(parent as MovieClip).gotoAndStop(“home”)


#3

WOW that worked perfect Thanks so Much MB.

I just bought your CMS File editor/upload tool because it is great and for all the support and info you have always given for me. :slight_smile:


#4

Thanks :slight_smile:


#5

Hey Uncharted,

Although that code works great, I find that sometimes using the following method can also help with climbing the ladder:

var grandaddy:MovieClip = MovieClip(this.parent.parent); grandaddy.gotoAndStop("home");

#6

woah super cool that will come in handy for sure Jack thanks so much. I owe you one. :slight_smile:

all code copied and pasted for secure storage and another day


#7
Thanks :)

No, Thank you. It was my pleasure. :slight_smile:


#8

I usually use:

MovieClip(parent).something…

basically the same as what the others have said, but just another alternative.


#9

thanks everyone for the great help I have collected and documented all code for my library. yall ROCK