2 Replies Latest reply on May 11, 2010 12:54 PM by jerry98225

    Noob Flex Questions - Run Application

    jerry98225

      Hi All

         I am trying to learn Flex 4 and having a question.

       

      When I download the sample files from Adobe website, I tried to open the files in Flex but it told me that I have to select

      New -> Flex Proejct -> Assign the file folder location to create a new Flex project. Then I created one with my own project name.

       

      Flex then created a new src folder with my new project name.mxml file. "THE FILE I WANT TO OPEN IS ON THEIR ORIGINAL FOLDER NAME." like

      Flex src or whatever the author created. I tried to run their mxml file, but the "Run Application" is grey out??!!. Why? I have to moved the mxml to my src folder? It seems dumb to me that I have to do this to open an existing project. Besides, if there is a subfolder with another subfolder under Flex src folder, when I moved them to my src folder, it created subfoldername.anothersubfoldername under my src (instead of subfolder/anothersubfolder that the original author created).  I know it might be a noob question, but what is going on here? I cant' even get the existing project running.........Thanks for any helps...

        • 1. Re: Noob Flex Questions - Run Application
          TeotiGraphix Level 3

          Hi,

           

          Your question is a bit confusing but here is a fundimental principle in Eclipse.

           

          Every project has;

           

          MyProject

            - bin

            - src

              - MyApplication.mxml

            - html-template

            - libs

           

          The 'src' folder holds all runable/compilable code actionscript classes and mxml components/applications.

           

          The only thing Flash Builder will run is a mxml file that subclasses s:Application or mx:Application or any subclass of them.

           

          Flash Builder will not 'just' run an mxml file. So if you get application samples from Adobe, you need to have them in the src folder and there needs to be a little green arrow in the top left corner. This means it's a registered application that you can run. The little blue dot in the top right corner means it's the default application that will run when you hit ctr-F11 or F11 or Run..

           

          If you paste a file that IS an Application and cannot get it to run, you need to;

           

          - make sure it's in your src folder

          - right click an select Run As

          - select Web Application

           

          This will run the app baring no compiler errors. If the mxml file is not registered as an application, this action will also register it.

           

          Hope that helps,

           

          Mike

          • 2. Re: Noob Flex Questions - Run Application
            jerry98225 Level 1

            Thanks a lot! TeotiGraphix. Sorry for the confusion.

             

            I got what you said about the Run application part. However, the folders I moved (ex: company/service ) to src folder become (company.service) instead of company/service. I tried to rename it to company/service but it gave me error. Anyway I can change it or that's the way it is. Thanks again!