-
Senior Member
Navigation in Flash Player between clips (2nd post)
Hi,
I have a file in which a horizontal menu helps the user go from one section to another. Each section calls a movie clip to play on the main timeline. The main movie only has one frame.
I would like to use back and next button so the user can view the last place he visited. This website is played entirely without using a browser (only plays with Flash player).
Is there a way to have back and forward buttons in my movie?
Newbie here
Thanks,
Luke
Live for the moment (not in frames!)
-
You could certainly do this. I would create an array and each time a person clicked a button, you would pass the instance name of the appropriate clip into the array.
Something like:
Code:
history=new Array();
currentStep=0;
function passInstance(instance){
history.push(instance);
currentStep++;
}
function back(){
if(currentStep>0){
currentStep--;
}
clipInstance=history[currentStep];
clipInstance.gotoAndPlay(1);
}
That should get you started anyway.
-
Senior Member
Array
Thanks for your reply. It helps.
Where do I enter your code? on which button?
Thanks,
Luke
Live for the moment (not in frames!)
-
The code I gave is for the first frame of the main timeline. Each button would say something like:
Code:
on(release){
passInstance("movie1");
}
You could even extend the passInstance function so it told the proper clip to play as well as track the progress.
-
Senior Member
In other words. I would have two buttons (back and forward) that I would place on the stage with those instructions (script). The user would select from another menu, what he wants to see (by clicking on button which would call a movieclip). This clip (clipX) would play then when the user presses the back button, he would go back to the place he was before.
so back button:
on(release){
passInstance("movie1");
foward button:
on(release){
passInstance("clipX");
Is this correct?
Thanks
Live for the moment (not in frames!)
-
Senior Member
Pass instance
How would you create the code for passing and playing the instances?
on my button I have written:
on(release){
passInstance("panel.swf");
holder.play();
}
it works when I have just started the movie playing but once I have clicked other menu buttons (say "products"), the back button does not return me to the previous movie clip.
also, should my code include the name of all my clips and if so, how do you list them? passInstance("panel.swf", "products.swf", etc.)?
Many thanks,
LUke
Live for the moment (not in frames!)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|