Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

LInks in Flash CC after automatic transition to new scene are not working

New Here ,
Apr 26, 2014 Apr 26, 2014

I have a flash file containing three scenes- Scene1, Scene2 and Scene3. In Frame1 I have a loading screen animated with motion tween. I also include a function, which automatically transfer me to Scene2 after 10 sec. However after I go to Scene2 the buttons to go to Scene3 are not working. I've tried to remove Frame1 and then the buttons that are linking Scene2 and Scene3 are working, Do you have an idea where the problem might come from? Here is my code:

var loadNumber = 0;  stop();  loadingPercents.text = loadNumber.toString() + "%";   /* Countdown Timer Counts down from a specified number of seconds.  Instructions: 1. To change the length of the countdown, change the value 10 in the first line below to the number of seconds you want. */  var fl_SecondsToCountDown:Number = 10;  var fl_CountDownTimerInstance:Timer = new Timer(1000, fl_SecondsToCountDown); fl_CountDownTimerInstance.addEventListener(TimerEvent.TIMER, fl_CountDownTimerHandler); fl_CountDownTimerInstance.start();  function fl_CountDownTimerHandler(event:TimerEvent😞void { trace(fl_SecondsToCountDown + " seconds"); fl_SecondsToCountDown--; loadNumber +=10; loadingPercents.text = loadNumber.toString() + "%";  }    stage.addEventListener(Event.ENTER_FRAME, fl_EnterFrameHandler);  function fl_EnterFrameHandler(event:Event😞void { if (loadNumber > 99) {  gotoAndPlay(1,"Frame2"); } }

and for scene3:

import fl.motion.MotionEvent;  stop();   BackFromPrizes.addEventListener(MouseEvent.MOUSE_UP, goBackFromScene3);  function goBackFromScene3(event: MouseEvent😞 void {  gotoAndStop(1, "Scene2");  }

Thanks

TOPICS
ActionScript
728
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 26, 2014 Apr 26, 2014

the code for the scene2 buttons needs to be in scene2 on the keyframe where those buttons exist.  there are also other possible issues if those buttons exist on more than one keyframe.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 26, 2014 Apr 26, 2014

Thanks for your reply klag. Actually the code that you are talking about is there. After loading the initial 10 sec the app is automatically moving to the new scene where the links does not work.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 26, 2014 Apr 26, 2014

use the trace funciton to debug your code.  make sure your goBack function is being called when you click your BackFromPrizes button.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 30, 2014 Apr 30, 2014

kglad thans for your reply. I trace it and it is catching the trace but it is not mooving to the next scene. Do you have an idea why is that?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 30, 2014 Apr 30, 2014
LATEST

if the code you showed fails (and it's executing), you have no scene named "Scene2".

btw, "Scene2" is not the same as "Scene 2" or "scene2 or "scene 2", which would all be common typos.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines