PDA

View Full Version : Last Frame Viewed


Clayf700
07-31-2010, 08:48 PM
I'm Trying To Get One Of The Simplest Of Scripts But I Can't Find It Anywhere for some reason.

How Do You Go To The Last Frame Viewed?!
I'm Really Confused... pls help:confused:

Solarflare
08-01-2010, 10:43 PM
If you mean how to go to the preceeding frame, then it is prevFrame();

Zymiily
08-02-2010, 06:23 PM
Lets say u got 10 frames, so the last frame is number 10.
Just write,
on(release) {
gotoAndStop(10)
}

Just put this code in a button.

or u could use:


Hope this helpes you out!

flashGeneral
08-03-2010, 08:24 PM
Here I have 3 frames, 4 buttons. 3 buttons navigate to their frames respectively and the fourth to the last frame viewed.
stop();
var lastViewed:int;

frame1_btn.addEventListener(MouseEvent.CLICK, gotoFrame1);
frame2_btn.addEventListener(MouseEvent.CLICK, gotoFrame2);
frame3_btn.addEventListener(MouseEvent.CLICK, gotoFrame3);
lastViewed_btn.addEventListener(MouseEvent.CLICK, lastView);

function gotoFrame1(event:MouseEvent):void{
lastViewed = currentFrame;
trace(lastViewed);
gotoAndStop(1);
}
function gotoFrame2(event:MouseEvent):void{
lastViewed = currentFrame;
trace(lastViewed);
gotoAndStop(2);
}
function gotoFrame3(event:MouseEvent):void{
lastViewed = currentFrame;
trace(lastViewed);
gotoAndStop(3);
}

function lastView(event:MouseEvent):void{
switch(lastViewed){
case 1:
gotoAndStop(1);
break;

case 2:
gotoAndStop(2);
break;

case 3:
gotoAndStop(3);
break;
}
}

Clayf700
08-07-2010, 03:03 AM
Thanx guys, i'll go try 'em out!