So a few coworkers of mine ran into a problem on an AIR project we are working on.  Our application involves a lot of music and sound generation which required us to use the new SampleDataEvent class in Flash Player 10.  Anyways, for some reason, 2 of my friends at work would get a random RTE saying:  “Variable SampleDataEvent is not defined”, yet my computer never gave me any problems with it.  To compensate for it, they would just avoid the part in the application where this error would be thrown.  After a few days they were put on other projects and the issue was no longer critical.

A few weeks later I was asked to build a custom Mac installer for this application, so I hopped onto a Mac, and wouldn’t you know it… the problem I had been avoiding finally hit me too.  I looked through forums and groups and found several people complaining about the same issue, but I couldn’t find a resolution to the problem.  I was sure that I had AIR 1.5.1 on my computer, so I wasn’t sure why FP10 wouldn’t have been targeted (which was my original suspicion).

Finally, I found the answer here.  I had to manually go into FLEX_SDK/frameworks/flex-config.xml and change


9.0.115

to this:


10.0.0

Then I added a compiler argument -target-player=10.0.0 and voila, no more RTE!  I am confused why Flex Builder 3.0.2 didn’t just have some sort of configuration setting for AIR in the first place!  It does for a normal Flex application… you go to Properties > Flex Compiler and set Target Flash Player version to 10.0.0.  Anyways, problem solved… hopefully this helps others with the same issue.