How do I get a current frame position from current scene?

DoronAviad
DoronAviad used Ask the Experts™
on
I have a flash with welcome scene that has a button that jumpes to another scene.
I need to jump back to that welcome scene when i rollout the mouse from the button, and i need the welcome scene to continue from the same frame i left when i moved to the other one, now the scene replays every time i rollout the mouse.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
You could save the frame number right before you jump to another scene, and use the saved frame number to go back and play it...

CyanBlue

Author

Commented:
Thanks

But what is the command I have to write in the Swish script in order to save the frame number ?
Code example will help

Commented:
Why don't you post what you have so that I have better idea???  I am not a psychic, you know...  ;)

CyanBlue
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
I am new to progaming and don't know scripts very good

My First scene has 50 frames, I have a Button on that scene, when a user click on that button I jump to another scene

How can I save the frame that was displayed just before the user click on the Button
and how can I use that var to jump back to the same place after the other scene is done ?


Something like:

in the Button Click Event
var lLastFrameNo as long
lLastFrameNo=getCurrentScenceFramNo



in the end of the other scene
GotoSceneAndPlayFrame("FirstScene",lLastFrameNo)


How do I write it in swish script ?

Commented:
Um...  Sorry...  I don't know swish script...  I've never used Swish before...

CyanBlue
Top Expert 2009
Commented:
Hello I personally have never used Swish before either but I went to check out Swish Script's syntax. It's very similar to AS1.

I hope CyanBlue don't mind if I try helping.

On the button add

on (press) {
 lastFrame = _root._currentframe;
gotoSceneAndPlay("somescene");
 }

On the button that when roll out you want to jump back to the original frame

You do

on (rollOut) {
gotoSceneAndPlay("FirstScene", lastFrame);
 }

To be honest, this kind of syntax is not really good, so if you can afford it I suggest you to upgrade to Flash instead. Even AS2 is a lot better than this AS1-like Swish Script.

Author

Commented:
Thanks

How can I know the name of the current scene ?
is there _rrot._scene ?
Top Expert 2009

Commented:
I don't know and don't think it is possible.

However, you can use something like this

gotoSceneAndPlay("<current scene>", lastFrame);

to reference the current scene and go to a specific frame.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial