We help IT Professionals succeed at work.

how to move to specific frame in “snap_1?

Ayman_fma
Ayman_fma asked
on
I  create flash file for my company . how to move to specific frame in “snap_1” ,I create four buttons in four layers and another layer called “pages” inside this layer I create a movie clip inside this movie there four frames”snap_2” I want to know how to move to frame one when I click the button “one”, and how to frame 2 when I click button “two” , and how to frame 3 when I click button 3 and and how to frame 4when I click button “Four” ? snapshot 1Im using ActionScript 1.0 & 2.0
snap-2.gif
Comment
Watch Question

Top Expert 2011
Commented:
You need to use on(press) and gotoAndPlay

I found a good tutorial on youtube

http://www.youtube.com/watch?v=3HoLUMVtOVw

Author

Commented:
Can you explain in more details ?
Top Expert 2011

Commented:
did you check a video?

Author

Commented:
Yes thanks in advance but I have a simple Question,
The frame that I wanna to reach is in another movie clip in another layer
Top Expert 2009
Commented:
the layers don't matter, you simply need to give your movieclip an instance name (look in the properties window)

You have 2 options
1. put the code directly on the button
or
2. give the button an instance name as well and put the code on the timeline.

if you do the first

on (release)
{
_root.otherMovieclipInstanceName.gotoAndStop(whicheverFrameYouwant);
}

option 2

buttonInstanceName.onRelease = function()
{
_root.otherMovieclipInstanceName.gotoAndStop(whicheverFrameYouwant);
}

Author

Commented:
Thanks blue-genie but I tried both of them but it’s not working
Top Expert 2009

Commented:
do you get errors? what's happening?
which version of Flash (IDE) are you using?
it' a bit difficult to help you if we can't see what you're doing.

can you paste the code that you used here and also say where you put that code (screenshot would work)

Author

Commented:
I tybed this code
one.onRelease = function()
{
_root.main_1.gotoAndStop(1);
}
snap-3.gif

Author

Commented:
And I tryed this code
on (release)
{
_root.main_1.gotoAndStop(1);
}


Im using Adobe flash cs3

Author

Commented:
Top Expert 2009

Commented:
okay some quick flash 101

if you look at your actions panel (where you put the code) - you'll notice it says Actions - Button or Actions
this tells you where you're currently trying to place your code.

if you're do this

on (release)
//do something etc;
}
it has to go on the button - that's why you get the "Statement bust appear within on handler" error message.

do the
one.onRelease  = function() { one but make sure you're in the Actions for the frame - ie. click the frame where the button is - don't select the button, it should just say Actions or Actions - Frame


Top Expert 2011

Commented:
Ayman_fma,
Why you don't want to submit your FLA in CS4 format?
We can check and fix your file

Author

Commented:
Thanks For The Good Efforts