| Author |
Back Button problems
|
|
| reedharris 2005-04-07, 7:18 am |
| Please Help -
Does anyone know how to make the back button return to the previously viewed
frame NOT the previous frame i need this script or function as i am working on
someone elses already created flash file and there is no space to drop in back
buttons all over the shop the file is running 6 movies with 6 sub sections and
each subsection has loads of different frames with different info but i can
only fit 1 back button in which all the frames are jumping to BUT the buck
button only jumps to the 1st frame i NEED it to jump to the LAST VIEWED FRAME
PLEASE HELP
Thanks People !!!!!
| |
| spider_stan 2005-04-07, 11:16 pm |
| I?m really not certain I understand you, but here goes?
Create two variables on the main timeline of the document.
var currentFrame:String = null;
var previousFrames:Array = new Array;
Then set up a function for when ever you send someone to a new frame like.
function sendToFrame(sendToThisFrame:String){
// Add current frame to the array of previous Frames
previousFrames.push(currentFrame);
// Set Current Frame to new Frame
currentFrame = sendToThisFrame;
// Send the play head to the new frame
gotoAndPlay(currentFrame);
}
You?ll need to change all of your calls to move the playhead around to use
this function rather than using gotoAndPlay();
ie: instead of using gotoAndPlay(?introFrame?); you would use
sendToFrame(?introFrame?);
then for the backbutton set up?
backbutton_btn.onPress = function(){
currentFrame = previousFrames.pop();
gotoAndPlay(currentFrame);
}
Hope this makes sense, and solves the problem for you.
-Stan
| |
| gmain53 2005-05-24, 7:33 pm |
| I cant get that code to work.
I tried exchanging gotoAndPlay with the sendToFrame but the playhead does
not move.
is the funtion script supposed to go on the first frame too?
please help, thanks, KKYLE
|
|
|
|
| Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |