Copy link to clipboard
Copied
Hello
I'm currently doing my year 13 ICT coursework and was trying to find an easier solution for my button/ navigation system.
My product has several scenes; a home page, 4 subsection pages and a quiz page.
currently when I press a button (to go from the home to a subsection for example) it jumps to the page like needed however I need to add in transitions, I could add in new scenes that would contain the separate transition but personally I think that would take too long creating a scene for every transition needed for the product so I was wondering, is it possible to combine a variable with a button?
My idea was that on the home page there are 4 main variables, 1 for each button.
Then when a button is pressed it will continue to play the scene while changing the variable by +1 (so in this case, button A will change var A to +1 and continue to play)
Then when the transition has ended there would be some script of "if statements" saying: if variable A = 1 then continue to subsection A
also I would then need to subsection page to reset the variables back to 0, ready to use again
I hope this question make sense, if it does not please let me know
thanks
Copy link to clipboard
Copied
sure.
you can have 'outro' scene that would display the fade-out or some other transiition out from your main scene and use the variable set by your button to determine which scene to display after the outro:
eg:
var nextscene_var:String;
scene1_btn.addEventListener(MouseEvent.CLICK,scene1F);
function scene1F(e:MouseEvent):void{
nextscene='scene1';
gotoAndPlay(1,'outro');
}
scene2_btn.addEventListener(MouseEvent.CLICK,scene2F);
function scene2F(e:MouseEvent):void{
nextscene='scene2';
gotoAndPlay(1,'outro');
}
//etc
// on the last frame of your outro scene:
gotoAndPlay(1,nextscene);
Copy link to clipboard
Copied
Hello
Sorry for such the late reply but I've been very busy with other subjects work.
I have tried to use this script and it has worked wonderfully
many thanks
Tom
Copy link to clipboard
Copied
you're welcome.
(p.s when using the adobe forums, please mark helpful/correct responses, if there are any.)
Find more inspiration, events, and resources on the new Adobe Community
Explore Now