Compile Flash 10 libraries in Flex Builder 3
In a previous post (cf. Work with Flash 10 in Flex Builder 3), I explained how to start using Flash 10 with Flex Builder 3 in a "classic" Flex Project. But if you want to create a Flash 10 Flex Library Project, it is a little bit more tricky.
The Problem
The main problem is that even if you select a Flash 10 Flex SDK, Flex Builder configure the compiler to use Flash 9 only. In my first article, I explained that a simple solution was the following :
- Open the Properties of your Flex Project (right click on the project in the Flex Navigator tab then “Properties”)
- Go to “Flex Compiler”
- Check “Use a specific SDK” and select the SDK you just installed
- Check “Require Flash Player version” and set the value to 10.0.0
But the thing is you can not specify a "Required Flash Player version" for a Flex Library Project. When you will try to compile, any reference to a Flash 10 class will cause an error even if you have selected the right Flex SDK (steps 1, 2 and 3 above).
The Solution
The solution is rather simple :
- Close Flex Builder
- Go to the root folder of your Flex Library project
- Open the file named ".actionScriptProperties" with your favorite text editor
- Search for htmlPlayerVersion="9.0.28" and change it to htmlPlayerVersion="10.0.0"
- Launch Flex Builder 3
- Try to compile your Flex Library Project
Your project should compile normaly and Flash 10 classes wont cause any error anymore.
Nevertheless, it is quite weird to have to change the "htmlPlayerVersion" to "10.0.0" in order to compile properly. It seems the "htmlPlayerVersion" is actualy used to do more than just setting the HTML wrapper...
March 7th, 2009 - 09:44
It is weird that this problem still exists. It takes a lot of wasted hours from development community as a whole!!! March of 2009!!!
March 7th, 2009 - 10:18
For a Flex Builder library project
Additional compiler arguments:
-target-player=10.0.0
July 18th, 2009 - 22:40
Thanks for the post.