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

How to get the frame number of a label in a different scene.

New Here ,
Apr 12, 2013 Apr 12, 2013

I am completely stumped on this.

I have my project setup as the gameplay in one scene, and another scene for the outcome.

The outcome scene, say called, GameDone, has 2 frames. The first frame for win, labeled it WON, the second frame for lost, labeled LOST.

I could do the very simple thing and just gotoAndStop("GameDone", 1); but thats a bad practice, I believe.

Ive gone through google and found the closest thing needing a MovieClip. I could not figure out what to give it? A random MovieClip? a new one? one from the next scene? one from the current scene?

import flash.display.Scene;  

for (var i:uint = 0; i < mc1.scenes.length; i++) {
     var scene:Scene = mc1.scenes;
     trace("scene " + scene.name + ": " + scene.numFrames + " frames");
}

That was an adobe sample.

So how could I, in the gameplay scene, the frame number for either WON or LOST in the "GameDone" scene?

Thanks.

TOPICS
ActionScript
1.1K
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

correct answers 1 Correct answer

LEGEND , Apr 12, 2013 Apr 12, 2013

Try doing the simple thing that you think is a bad practice.  I don't know why you think it is.  The only problem with it is that you appear to have it backwards for AS3... in AS3 it is gotoAndStop(frame,scene);

Why don't you use the frame labels instead of frame numbers?  gotoAndStop("Won", "GameDone");

Translate
LEGEND ,
Apr 12, 2013 Apr 12, 2013

Try doing the simple thing that you think is a bad practice.  I don't know why you think it is.  The only problem with it is that you appear to have it backwards for AS3... in AS3 it is gotoAndStop(frame,scene);

Why don't you use the frame labels instead of frame numbers?  gotoAndStop("Won", "GameDone");

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 12, 2013 Apr 12, 2013

EDIT:

My bad, you had it right, I actually messed up the cases, I was trying WON when it was Won, same with LOST.

Thanks.

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
LEGEND ,
Apr 13, 2013 Apr 13, 2013
LATEST

You're welcome

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