Variable SampleDataEvent is not defined
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
to this:
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.
This is really strange error, which could not be obviously solved…Thank you for your help!!!
Thanks – this really helped me out!
man thanx for this post, it helped me continue with my project. have a good night!
The info you posted prooved really helpful for me for flex SDK’s
target player issue.but i am stuck with AIR’s problem.I always get the sampleDataEvent not defined for AIR,Altough the SDK’s are upgraded.Any help would be valuable
Hi Mitesh,
SampleDataEvent is only available in AIR 1.5. I am guessing that you are pointing to either AIR 1.0 or 1.1 which will not work. To fix this, you simply need to change you application xml description file (-app.xml) to the 1.5 URL.
So, change the line:
http://ns.adobe.com/air/application/1.0
to:
http://ns.adobe.com/air/application/1.5
and everything should work fine for you.
I am very thankful,for your valuable suggestion as you pointed out that AIR should be 1.5 in -app.XML,i found that the AIR that i had was still needed to upgraded, i was in the perception
that AIR automatically upgrades itself with flex sdk’s upgradation.now i did the AIR’s upgradation to 1.5.2 but now i get compile time error mx.core.windowedApplication not located.May u please tell me the correct steps to upgrade AIR ,Again i want to thank you for flex sdk’s upgradation info because your info bought me out of a pit.
Are you experiencing this error when you try to compile in Flex Builder? If so, verify that the airglobal.swc is located in [WHEREVER YOUR SDK IS]/framewoks/libs/air. Sounds like the compiler is just not finding the path to this SWC (which contains WindowedApplication).
Thank you i found that someone had deleted all the files inside air. now i did every thing fine i guess ,the AdobeAir.dll shows me version 1.5.2 (which is in (SDK PATH)\runtimes\air\win\Adobe AIR\Versions\1.0).and also changed the
i still get the same error sampleEventData not defined ,past one week i am pullin ma hair out for upgrading AIR.Bye the way thanks for your help.
line:
http://ns.adobe.com/air/application/1.0
to:
http://ns.adobe.com/air/application/1.5,
But to no vail
Odd… what version of Flex Builder are you using? 3.0.2? And what version of the Flex SDK?
Flex builder is 3.0.0 and flex sdk 3.3 ,flex works sucessfuly but only AIR is not performing…..may be i should try for flex builder 3.0.2….i will give one more try….:)