Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-27-2012, 11:14 PM   #1
TheBirdBag
Nooblet
 
Join Date: Apr 2012
Posts: 3
Default Using a MovieClip to affect the timeline.

Hello, I've been attempting to use a MovieClip as a button and make it use the gotoAndStop method on the timeline. But I'm unsure how to do that.

The code I use for this was like this:
Code:
function startGame(evt:MouseEvent):void {
	gotoAndStop(3);
	Parent.gotoAndStop(48); //Here is where I'm unsure
}
addEventListener
	(MouseEvent.MOUSE_DOWN, startGame);
What I'm having trouble with is where I need to define that I want to change the frame on the Main Timeline, rather than the MovieClip's timeline. (The code is on a frame in the MovieClip's timeline.)
TheBirdBag is offline   Reply With Quote
Old 04-27-2012, 11:46 PM   #2
abeall
Senior Member
 
Join Date: Feb 2006
Location: Washington, DC
Posts: 2,812
Send a message via AIM to abeall
Default

To access the main timeline, use this:
ActionScript Code:
MovieClip(root).gotoAndStop(48)

parent would also work if your MovieClip is not nested in another MovieClip:
ActionScript Code:
MovieClip(parent).gotoAndStop(48)
__________________
Aaron Beall | Flash portfolio | Fireworks extensions | Twitter
abeall is offline   Reply With Quote
Old 04-27-2012, 11:51 PM   #3
TheBirdBag
Nooblet
 
Join Date: Apr 2012
Posts: 3
Default

Thanks, it helped a lot. That will make things a quite a bit easier.
TheBirdBag is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:48 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.