Button to go to another scene

Posted by tphoto 
Button to go to another scene
July 08, 2009 08:06PM
I'm using the FlashEff2 button. When pressed, I need to go to a different scene. I used FECGoToFrame to jump to another frame within that scene, but what Command do I add to get the button to take you to the first frame of scene2 for example?
Thanks, Jay
Re: Button to go to another scene
July 09, 2009 08:19AM
We recommend not using more than one stage. If this is not an option you could write a function that jumps to another stage at a certain frame and call it with FECCallFunction.
Here is how you use FECCallFunction:
Create a new function that goes to a frame
function myFunction(){
In the Panel set the Function parameter as the name of the function, in this case it would be myFunction. When the function is called it will execute the code and go to frame 5.
Re: Button to go to another scene
July 09, 2009 02:43PM
Thank you for your answer. It seems that when designing an entire website in Flash that making each page a separate scene is a good practice. The whole purpose of a button is to go somewhere else. I just wish it had the control to go to any frame in any scene. AS3 has certainly been a challenge for those of us who would rather be designing instead of coding. I was hoping FlashEff would be my solution to automate such tasks, in addition to slick visuals. Is there a way to us the FECCallFunction to accomplish this? I'm sure my question reveals my lack of AS3 knowledge. (If not, you've given me a potential way of handling it, which is disappointing, but better than nothing.)
Re: Button to go to another scene
July 09, 2009 02:58PM
Here is what you'll have to do. On the same frame where you have your component make sure you write the following code:
function gotoSceneAndFrame(){
gotoAndPlay(1, "Scene 2");
I gave a random name to the function and said that it should go to scene 2 frame 1.
On the button tab go to command and add the FECCallFunction pattern. There you will add on the function parameter: gotoSceneAndFrame

There is another way to do this, and I think this will be easier for you.
This way does not require any action script.
Click the component that is attached to the button you want to do the changing stage action.
Go to the button tab, then to the command tab on the second row and import FECCallFunction.
On the function field write: gotoAndPlay or gotoAndStop depending on the action that you want to do once you go to the scene.
On the parameter field write: 1, "Scene 2"
1 -represents the frame from the stage that you want to go to.
"Scene 2" - represents the scene that you want to jump to. Keep in mind that you need the "" in order for this to work.

Hope it helps.

Re: Button to go to another scene
July 09, 2009 07:14PM
This is great help. I really appreciate your response. I like this solution you've posted here. I also figured out another work around. My main "home" timeline is 400 frames. The other scenes are 100 frames each. So, on the button for "scene 2", I used FECGoToFrame 401. Because of the length of scenes, "scene 3" would be 501, and so on. I'm hosed if I change the length of any scene, as I'd have to recalculate the frames, and go into FlashEff2 for each button instance to put in the new frame number. Your solution is better. Thank you.
Sorry, you do not have permission to post/reply in this forum.