I have this very same problem. From doing a bit of Googling, I’ve come to understand that the problem seems to be that one shouldn’t compile/run an AS3 application from a component (a subclass of mx.controls.* or, in my case, from a MovieClip), lest you will have this error. Compile/run from your Application class instead.

Not sure if this will really solve the problem (since I’m a n00b at AS3 and I haven’t got to testing it yet) but it seems quite logical to me!