Groups | Blog | Home
all groups > flash actionscript > april 2005 >

flash actionscript : Navigating from a movie clip to another movie clip's frame


vrish88
4/23/2005 7:55:36 PM
I have a movie clip that has buttons that are rotating in a circle. When you
roll over a button the clip stops and it highlights the button. What I want to
have is when you roll over it, a description pops up above the entire movie
clip. This would be another movie clip. So is there a way to have a movie clip
tell another movie clip to go to a specific frame in itself.

thanks
kglad
4/23/2005 8:46:04 PM
sure. give your pop-up movieclip an instance name, say popupMC. then, if the
movieclip containing your buttons has instance name menuMC and your buttons
have instance names btn1,btn2 etc, you can use:

for(i=1;i<butNum;i++){
menuMC["btn"+i].ivar=i;
menuMC["btn"+i].onRollOver=function(){
popupMC._visible=1;
popupMC.gotoAndStop(this.ivar);
}
menuMC["btn"+i].onRollOut=function(){
popupMC._visible=0;
}

vrish88
4/24/2005 12:00:00 AM
so how would I tell it to go to a specific frame or is that already in the code? i can only do fairly basic stuff w/ actionscripting
cmorrissey
4/24/2005 12:00:00 AM
You can tell any movieclip to go to a sepcific frame, for example

myMovie.gotoandPlay(25);

this will tell that movieclip to goto and play frame 25

you clould do this after your

myMovie._visible = true;

Does that work, im confused on what you are looking to do


vrish88
4/24/2005 12:00:00 AM
go to http://www.regisvolleyballcamps.com/Flash/bg_camps.swf this is where i
would use it. when you mouse over one of those rotating buttons the description
for that specific button would pop up where the text is
kglad
4/24/2005 12:00:00 AM
vrish88
4/25/2005 12:00:00 AM
Originally posted by: kglad
the code i gave has btni direct popup to frame i.

I am confused about what btni is. is that just the variable button and how do
i specify about which frame to go to in the script
kglad
4/25/2005 12:00:00 AM
i gave an example of coding that has btn1 direct popupMC to stop on frame 1 and
btn2 directs popupMC to frame 2 and btn3 directs popupMC to frame 3 etc. you
can edit the code to suit your particular needs.
vrish88
4/26/2005 12:00:00 AM
so i applied the code to the first frame in my "actions" layer and the only
thing that i can get it to do is to go to the first frame and when you roll off
of it the popupMC disappears. the only button that does that is btn1 and the
other btns don't do anything
kglad
4/26/2005 12:00:00 AM
vrish88
4/26/2005 12:00:00 AM
vrish88
4/26/2005 12:00:00 AM
kglad
4/27/2005 12:00:00 AM
vrish88
4/27/2005 12:00:00 AM
kglad
4/27/2005 12:00:00 AM
vrish88
4/27/2005 12:00:00 AM
kglad
4/27/2005 12:00:00 AM
so far, in your movie, you have 5 buttons. so, you should use butNum=6;

if you added more buttons you would increase the value of this variable so
that for-loop will define an onPress handler for each of your buttons: btn1,
btn2,...
vrish88
4/27/2005 12:00:00 AM
kglad
4/28/2005 12:00:00 AM
AddThis Social Bookmark Button