问题描述:

I'm new to flash and I'm working on this project for class. I'm creating a demo game with two separate scenes.

I created Scene 1 to have 60 frames of action.

I have 5 clouds on 5 separate layers with a new motion tween applied to all the cloud layers, so the clouds will move from both sides of the screen and end up in their given place on the stage.

There is also a "PLAY" button (instance name: playbtn)on the stage too, when clicked it should go to Scene 2.

The actionscript and button are each on separate layers, both at the top of the timeline.

I've given the button this actionscript to do so inserted on keyframe 1:

function onPlayClick(event:MouseEvent):void{

gotoAndPlay(1,"Scene 2");

}

playbtn.addEventListener(MouseEvent.CLICK, onPlayClick);

stop();

When I test the movie, it plays Scene 1 all the way through and immediately goes to Scene 2. The problem is that my type font that I have on the stage does not appear when movie is test played. It also does not give me the option to click the play button because it goes straight into the next Scene without stopping.

I want Scene 1 to stop at the end of frame 60, without looping or going to the next scene, allowing the user to be able to click the play button.

So I put stop(); in the actionscript at keyframe 1 but that only removes the text I have on Scene 1. I even tried to put stop(60); at keyframe 60 to see if the scene would stop there, and that give me the same result as before.

It also displays a strange message before the test movie:

"Your content will not stream. Runtime Shared Library preloading will require all of your content to download before the first frame will play."

The output in Flash also says "ReferenceError: Error #1065: Variable TCMText is not defined."

I'm not sure what to do and I couldn't find anything matching my problem anywhere online.

Thanks for reading!

网友答案:

Quote "I want Scene 1 to stop at frame 60" Simply add:

stop(); // make sure this is a keyframe aswell

there are other methods aswell to achieve in A classfile aswell.

To address your other problem, define all your assets when they are created, if your lazy just do it on your first frame and them hide them until needed

myMc.visible = false// declare variables first

Problem 3: "Fonts" You must embedd your fonts for dynamic texts boxes, you can do this by looking at your modiefiers tab and selct embed.

problem 4:"Variable" Variable TCMText is not defined.

  var TCMText = "";//declare like this at start of script
相关阅读:
Top