Tip of the Day – Compile your AIR Applications for Flash Player 10

I was playing with Cocomo today and hit a wall dealing with the Flash Player 10 version of Cocomo.swc while using Adobe AIR. I created a new AIR application in Flex Builder 3, and pointed it to the Flex SDK 3.2. I then linked in the FP10 version of Cocomo.swc. Everything was going fine until I tried to run my application and it threw “Error #1065: Variable SoundCodec is not defined.”

After doing a bit of research, I learned this error occurs when trying to run Flash Player 10 code in the Flash Player 9 runtime. I thought Flex Builder would handle this for me automatically when I pointed it to the 3.2 SDK.

So here is the fix and your tip for the day.
Within Flex Builder:

  1. Select your AIR application in the Flex navigator
  2. From the menu choose, Project > Properties
  3. Choose “Flex Compiler”
  4. Add “-target-player=10″ to your Additional compiler arguments
  5. Click OK

This isn’t limited to Adobe AIR, you can set the target player of your Flex applications as well.

Related Posts

Comments Closed