Groups | Blog | Home
all groups > flash (macromedia) > may 2004 >

flash (macromedia) : Several buttons play movieclip


xico trujano
5/26/2004 11:36:43 PM
Hi, I have this doubt and I haven't found information about how to do it, if
anyone can show me the way it will be well appreciated.

I have 5 buttons and all of them should tell a movieclip to play like this:

The movieclip goes tweening to

button1------button2--------button3------ button4-------button5
keyframe5---keyframe10---keyframe15--keyframe20---keyframe25

If put my mouse over button 3 the movie clip should go to keyframe15, if I
put my mousever button 5 the movie clip should go to keyframe25 from
keyframe 15 and if I put my mouse over button 2 it should go to keyframe10
from keyframe15 playing backwards, and so on, the buttons should tell the
movie clip to play to a specific keyframe whenever they are, playing forward
and backward depending on the place they are.

Can this be achieved?, I've been searching for info for this but no luck so
far, can anyone tell me where to find information about this matter??

Thanks
Xico
seb
5/27/2004 1:36:21 AM
do you actually want the movie to PLAY backwards if necessary, or just
to jump to the specified frame?

[quoted text, click to view]
Jeff North
5/27/2004 4:55:20 AM
On Wed, 26 May 2004 23:36:43 -0500, in macromedia.flash xico trujano
[quoted text, click to view]

The buttons need to appear for the entire timeline.
Each button will have the code attached to it
on( release )
{
gotoAndPlay(<your frame number>);
}
---------------------------------------------------------------
jnorth@yourpantsbigpond.net.au : Remove your pants to reply
xico trujano
5/27/2004 10:46:10 AM
Yeah I want to play backwards :)


On 27/5/04 00:36, in article c93uol$4sc$1@forums.macromedia.com, "seb"
[quoted text, click to view]

seb
5/27/2004 12:05:27 PM
ok here's a tip somebody sent me a while ago. I've used it and it works:


Make a new movieClip with 3 frames, with no graphics in it and it should
have
this structure

Frame1: Label: "fStop"
Frame2: Label: "fRewind"
Frame3: Label: "fRewLoop"

Now, on Frame1 add these actions

-------------------------------------
function playBackward($mcPath){
if(eval($mcPath)._currentFrame > 1){
eval($mcPath).prevFrame();
} else if (eval($mcPath)._currentFrame == 1) {
eval($mcPath).gotoAndStop(eval($mcPath)._totalFrames);
}//End if
}//End function
stop();
------------------------------------

Frame 2:

if(rewind == true){
playBackward(_level0.myMC2Rewind);
}//End if

----------------------------------

Frame 3

if(rewind == true){
playBackward(_level0.myMC2Rewind);
gotoAndPlay(_currentFrame-1);
} else { gotoAndStop("fStop");
}//End if

----------------------------------

That's all there should be in this movieClip. Exit the editing mode for this
movie and return to stage. From your library drag an instance of this
movieClip
we have just created and give it an instance name of mRewinder. It
should look
like a litte circle and you can place it anywhere. It will not show in your
final movie since there is nothing in it!!

Now, onto your button. For this example, I will presume that the movie
you want
to rewind is called myMC2Rewind and lives on _level0 So the path I will
use is
_level0.myMC2Rewind

You can simply modify it to target the actual path of the movie to
rewind. If
you follow this example complety, I have used "_level0.myMC2Rewind" 3 times.

Let's get to your button.

--------------------------------------
on (rollOver) {
if(_level0.mRewinder.rewind == true){
_level0.mRewinder.rewind = false;
}//End if
_level0.myMC2Rewind.play();
}//End rollover

on (rollOut) {
_level0.mRewinder.rewind = true;
_level0.mRewinder.gotoAndPlay("fRewind");
}//End roll out
---------------------------------------


That's all there is to it. The function playBackward will take care of
rewinding
the movie.



[quoted text, click to view]
AddThis Social Bookmark Button