5 Replies Latest reply on Jul 30, 2012 8:53 AM by sinious

    No output ... ?




      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?

        • 1. Re: No output ... ?
          Ned Murphy Adobe Community Professional & MVP

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

          • 2. Re: No output ... ?
            milanfiala Level 1

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

            • 3. Re: No output ... ?
              sinious Most Valuable Participant

              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.

              • 4. Re: No output ... ?
                milanfiala Level 1

                Well done! Thanks for your hepl

                • 5. Re: No output ... ?
                  sinious Most Valuable Participant

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