ActiveDen

gotoAndStop.parent("home") AS3 ?

905 posts
  • Has been a member for 5-6 years
  • Bought between 100 and 499 items
  • United States
unchartedrealms says

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”);

3 years ago
1234 posts
  • Has been a member for 3-4 years
  • Exclusive Author
  • Sold between 50 000 and 100 000 dollars
  • Elite Author
  • Bought between 10 and 49 items
  • United States
  • Referred between 50 and 99 users
MBMedia says
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 years ago
905 posts
  • Has been a member for 5-6 years
  • Bought between 100 and 499 items
  • United States
unchartedrealms says

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. :)

3 years ago
1234 posts
  • Has been a member for 3-4 years
  • Exclusive Author
  • Sold between 50 000 and 100 000 dollars
  • Elite Author
  • Bought between 10 and 49 items
  • United States
  • Referred between 50 and 99 users
MBMedia says

Thanks :)

3 years ago
4213 posts
  • Has been a member for 3-4 years
  • Contributed a Tutorial to a Tuts+ Site
  • Contributed a Blog Post
  • Community Superstar
  • Author had a Free File of the Month
  • Exclusive Author
  • Sold between 50 000 and 100 000 dollars
  • Bought between 100 and 499 items
  • United States
  • Referred between 50 and 99 users
CodingJack says

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");
3 years ago
905 posts
  • Has been a member for 5-6 years
  • Bought between 100 and 499 items
  • United States
unchartedrealms says

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

all code copied and pasted for secure storage and another day

3 years ago
905 posts
  • Has been a member for 5-6 years
  • Bought between 100 and 499 items
  • United States
unchartedrealms says
Thanks :)

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

3 years ago
244 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • United States
  • Referred between 50 and 99 users
JoeMC says

I usually use:

MovieClip(parent).something….

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

3 years ago
905 posts
  • Has been a member for 5-6 years
  • Bought between 100 and 499 items
  • United States
unchartedrealms says

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

3 years ago
by
by
by
by
by