PDA

View Full Version : Simple gotoAndPlay Question


Zalister
06-16-2005, 02:41 AM
I'm trying to make a button move the playhead foward a few frames, but am having a hard time figuring out what to define the area as. Right now I'm using:

go_button.onRelease = function (){
gotoAndPlay("Scene 1", 31);
};


go_button is the instance, obviously. And I think I've got everything else right. I just don't know what to put after gotoAndPlay

Any help would be appreciated, sorry for being such an amatuer.

Gibberish
06-16-2005, 05:14 AM
do not target scenes, use frame labels.

If you wanted to play frame 31 of the current scenes timeline:go_button.onRelease = function (){
gotoAndPlay(31);
};

If you defined a frame label on the frame you wanted to play then you would put:go_button.onRelease = function (){
gotoAndPlay("Some Label");
};

Zalister
06-16-2005, 11:01 PM
Thanks, I'll give that a shot.

oldnewbie
06-17-2005, 06:03 AM
A side note on frame labels...

No number only labels or at least not starting off with a number, no spaces, no caps, and no special characters other than the underscore... Thus someting like my_target1

tsunami
08-07-2005, 09:21 PM
:confused: Ok so I am trying to have one instance control two others - as in when I move the mouse over the one icon I have created it animates, as well as tells another MC to goto and play frame 2 placed on the same stage - code is as follows...

programming.onRollOver = function() {
tellTarget (programming) {
gotoAndPlay("programming_mov", 2);
}
};
programming.onRollOver = function() {
tellTarget (submenu) {
gotoAndPlay("submenu", 2);
}
};

when i export and attempt to rollover the MC with the instance of "programming" only the first tellTarget functions where as the second does not - All help is much MUCH appreciated, thanks in advance!

Gibberish
08-08-2005, 04:17 PM
There is no need for two seperate rollOvers

programming.onRollOver = function() {
tellTarget (programming) {
gotoAndPlay("programming_mov", 2);
}
tellTarget (submenu) {
gotoAndPlay("submenu", 2);
}
};

tsunami
08-08-2005, 10:13 PM
:) thanks!