It’s been a long time since I last played with Flex. I feel like starting from square one.
This also means that I have a more difficult path ahead of me, with my Flex Builder trial license already expired.
Fortunately, it’s not that hard to setup basic mxml auto complete functionality with a plain Eclipse installation with XML support.
First we need to define the .mxml file association in Eclipse (Preferences > General > Editors > File Associations).
Then map this file association to the XML editor (see screenshot below).
Add the Flex 3 schema (flex3.xsd) to Eclipse’s XML catalog.
Try creating a test mxml file and open it from Eclipse.
Test.mxml
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> </mx:Application>
You will most likely receive an Unsupported Type error.
Complete the process by adding the content type definition (shown below).
Close the mxml file and re-open. You should now be able to see the auto-complete functionality in action.
Hope this helps and let me know if you encounter any problems.
If you’re a student or a full time Flex developer, you shouldn’t even bother trying out the outlined steps.
Flex is free for students. But, if you make a living out of developing Flex apps, you might want to consider buying a license.
Related resources:






hey
Really nice tips!
will try to keep it in my mind
thanks!
Hi
i m using Ubuntu 8.10
my eclipsce version is 3.4
i did everything as above
the text is getting colored , but no auto-complete functionality
please help me, i would be happy if i could receive more info one howto run them with alternative compilers
Hi hemanth,
Can you check if basic XML completion (for non-mxml extension) works in your setup?
Which bundle of Eclipse 3.4 did you download?
Thanks.
Thanks for this post. Very helpful.
I’m new to Flex, but have started experimenting with Gumbo. Just wondering where the XSD file is stored for this or if there is a way I can create one programmatically?
Any pointers you might have on this would be greatly appreciated!
Best.
Hi mjw,
I don’t think you can find the XSD from the Flex SDK installation but I’m guessing that you can build it programatically.
Try to see if this project contain the instructions on how to do it.
HTH.
Clear and concise
Keep going, thanks for the content
Regards
Hey Thanx,
It works and really helping.
Great post.
Thanks
Is there any alternative for .as files as well ?
For .as files you might want to read on AXDT plugin for Eclipse though I haven’t tried it myself. If you’re on Windows, FlashDevelop (based on .Net) does code completion for both .mxml and .as files and it works pretty well.
@paul new version of AXDT will receive a lot of refactoring incl. xtext support instead of IMP. So it’s certainly going to improve.
For those struggling with AXDT setup, take a look at a rather comprehensive guide at http://tekkie.flashbit.net/flash/axdt-open-source-cross-platform-alternative-for-flash-development
¿Alternativas a Flash Builder para el desarrollo Flex en Entorno Java? « Java Mania // Aug 27, 2010 at 8:37 am
[...] Esta me gusta por ingeniosa: básicamente asociar los mxml al editor XML de Eclipse y asociar el XSD. Con esto tenemos [...]