using Maia's flex compiler

I am trying to use IDEA’s flex compiler and am having some trouble with it. My project is setup with 2 modules: 1)a flex client module and 2)a java server module with spring and web facets. I am building the java module with my ant script, but want to use IDEA’s builder for the flex module. The flex compiler settings has a place for the “Main class”. It’s a webapp project, and a flex module to boot, so does not have a class with a main() method in the application. Without the Main class set, running the flex module results in a popup prompting me to choose a Main class. Any suggestion/insight out there would be appreciated.  I've attached snapshots of the flex compiler settings and the run/debug configuration for the flex module.

I am using the Maia build 90.116.  Is the video demo’ing working with flex in Maia available yet?

Thanks,
-Mary



Attachment(s):
runDebugConfiguration.docx
flexCompilerSetting.docx
5 comments
Comment actions Permalink

Main class in Flex is not the class that has main() method. It is usually a class (defined either in *.as or in *.mxml file) that is inherited from mx.core.Application or mx.modules.Module class.
Main class is a Flex compilation setting so whatever gui or command line tool you use to compile Flex - in any case you specify main Flex class or file with main Flex class.

0
Comment actions Permalink

That would be a file named "video.mxml".  However, when I tried to specify that file in the Choose Main Class popup of the Flex Compiler Settings, the OK button remains disabled.  What is there to do?

-Mary

0
Comment actions Permalink

Welcome to Flex language programming
Mxml files define Flex classes. The name of the class is equal to the name of the *.mxml file without extension. Root tag (like <mx:Application/>) specifies parent class (as if you have wrote public class video extends mx.core.Application{...})
By the way Flex coding conventions recommend to start class name with an uppercase letter: http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions#CodingConventions-Classnames
So the answer is 'video' - this is the name of your main class.
By the way the text field 'Main class' in Flex Compiler Settings has a button to the right from it - it opens class chooser and suggests correct main class for you.

0
Comment actions Permalink

Yes, I tried using the "..." control next to the textbox, but as you can see from my attached file, the OK button remains disabled in both the Search by Name and the Project tab, indicating that the video.mxml file is not acceptable.  I also tried just typing in "video" in the textbox, but at runtime, I am told that there is a Flex Compiler Problem of "Main class 'video' for module 'video_flex' is not found.".  What else do I need to do?

Thanks,
-Mary



Attachment(s):
chooseMainClass.docx
0
Comment actions Permalink

At your screenshot I see that flex_src folder is marked as a library home. But it should be you source folder.
Please open 'Sources' tab for your Flex module settings and configure flex_src to be your source root. Then after pressing OK and indexing complete you'll be able to select 'video' class as main class. If you still face any problems please attach screenshot of 'Sources' and 'Dependencies' tabs.

0

Please sign in to leave a comment.