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

No output ... ?

New Here ,
Jul 30, 2012 Jul 30, 2012

Copy link to clipboard

Copied

Class

package {

// importing classes

import flash.display.Sprite;

// end of importing classes

public class Main extends Sprite {

          public function Main() {

          trace("Welcome to Concentration");

                              }

                    }

          }

I tested my file at the start. I would continue, but there is not any output (after pressing F2) ... where can be the problem?

TOPICS
ActionScript

Views

599

Translate

Translate

Report

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 , Jul 30, 2012 Jul 30, 2012

You're using a package so clearly you're using an external .as file for the code. Make sure the code is either in the same folder as the FLA or that you told Flash where to find it via Publish Settings for AS3.0 in the Source Path tab.

Your class is named Main so your external actionscript file should also be named Main.as

When you click anywhere on the black canvas the properties panel shows properties for the document like FPS, width, height, etc. There is a field called "Class" with a text inp

...

Votes

Translate

Translate
LEGEND ,
Jul 30, 2012 Jul 30, 2012

Copy link to clipboard

Copied

What have you done to tie this class file into the fla?

Votes

Translate

Translate

Report

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 ,
Jul 30, 2012 Jul 30, 2012

Copy link to clipboard

Copied

In the class, there is an area "target" and put the name of my fla

Votes

Translate

Translate

Report

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 ,
Jul 30, 2012 Jul 30, 2012

Copy link to clipboard

Copied

You're using a package so clearly you're using an external .as file for the code. Make sure the code is either in the same folder as the FLA or that you told Flash where to find it via Publish Settings for AS3.0 in the Source Path tab.

Your class is named Main so your external actionscript file should also be named Main.as

When you click anywhere on the black canvas the properties panel shows properties for the document like FPS, width, height, etc. There is a field called "Class" with a text input next to it. Simply enter this in there: Main

Do not put the .as file extension on it, just "Main"

Now hit the pencil icon next to the input you just typed Main in. It might ask you what application you want to edit the code in, if so just say Flash Professional. Otherwise it should open up your code and you should see your package and your trace statement. If you do, you have it set up correctly. Try that.

Also make sure in Publish Settings for SWF that you have not checked off to "omit trace statements" or you won't see the trace.

Votes

Translate

Translate

Report

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 ,
Jul 30, 2012 Jul 30, 2012

Copy link to clipboard

Copied

Well done! Thanks for your hepl

Votes

Translate

Translate

Report

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 ,
Jul 30, 2012 Jul 30, 2012

Copy link to clipboard

Copied

LATEST

Glad you got it working, please mark it answered so it's filtered. Good luck!

Votes

Translate

Translate

Report

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