;

PDA

Click to See Complete Forum and Search --> : Changing Frames


talytech
05-06-2007, 05:30 PM
I have movie that has 4 frames. I also have a movie clip with a contact label. I want to be able to click on the label and go to frame 4. How do I reference frame 4 from the movie clip using action script?

webdreamer
05-06-2007, 05:40 PM
_parent.
or
_root

talytech
05-06-2007, 07:23 PM
I don't understand what you mean. I tried the code below and it didn't work

{gotoandstop _root frame 4}

Could you show me the syntax?

webdreamer
05-07-2007, 05:01 AM
_root.gotoAndStop(4)

Use your flash manual. Open flash and press F1

Bob Hartzell
05-07-2007, 08:21 AM
Unless tweens are set to zero in the main movie, the above code won't work.

webdreamer
05-07-2007, 08:23 AM
Unless tweens are set to zero in the main movie, the above code won't work.
Who, what, where WTF???

Bob Hartzell
05-07-2007, 09:20 AM
Webdreamer, you are confused. This is not a flash forum.

webdreamer
05-07-2007, 09:23 AM
He he.

didnt notice the forum section before posting.

My apologies

talytech
05-07-2007, 02:17 PM
the tweens are set to 6. so if that code doesn't work, how do I reference the main stage from a movie clip?

Bob Hartzell
05-07-2007, 02:48 PM
You can set the default tweens in the main stage to 0 in Frames > Default Tweens. Then the argument 4 will work. Otherwise, you need to count the number of tweens up to key frame 4:
I think it is (6 + 1) x 3 + 1.

blanius
05-07-2007, 09:31 PM
Or just name the frame you need to jump to then use the name in you're gotoAndPlay

talytech
05-09-2007, 09:00 PM
I named the frame contact and put the following code on the contact button in the movie clip:

_root.gotoAndStop(contact)

It didn't work.

The error message: Line1:expecting a mouse event statement

Where can I find a tutorial on action script? Because my biggest problem is syntax. How do I make the code work (_root.gotoAndStop(contact))

blanius
05-09-2007, 10:15 PM
_root.gotoAndStop('contact')

talytech
05-10-2007, 05:39 PM
thank you .... that worked. it's funny how a simple line can cause the code not to work