A-ha - I think you're right. For example I tried this:
lg_ldr = new Loader();
try {
trace(lg_ldr["unloadAndStop"])
} catch(e:Error) {
trace("error")
}
With FP9 as the runtime, catch handles it. With FP10 as the runtime,
'function...' is traced.
Now I just need to find something a little less weighty than Loader to test
against. :)
On Aug 24, 2010, at 10:36 AM, Zeh Fernando wrote:
> Yep; see loaderInfo.swfVersion.
>
> http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/display/LoaderInfo.html#swfVersion
>
> "Or a way for a Flash Player 9 SWF to try and access a Flash Player 10
> property of some kind that won't return a compile error in the IDE?"
>
> Instead of trying
>
> SomeClass.SomePropertyThatOnlyExistsInFlash10
>
> You can do
>
> SomeClass["SomePropertyThatOnlyExistsInFlash10"]
>
> This won't throw an error in during compiling, but it WILL throw an error
> during execution if you just deliberately try using the property/method if
> it's not available.
>
> If you're talking about built-in, native APIs, however, whether something is
> available or not is dependent on the Flash Player being used, and not the
> target SWF version.
>
> Zeh
>
>
> On Tue, Aug 24, 2010 at 10:04 AM, Todd Dominey <
> [email protected]> wrote:
>
>> Hi everyone -
>>
>> I have an AS3 component that publishes to either Flash Player 9 or Flash
>> Player 10, and I'm trying to figure out a way to detect (within the
>> component's ActionScript) whether the user published the SWF to 9 or 10 as
>> their target. I realize the SWF is agnostic to the IDE and won't be able to
>> see that directly, but is there a way for the SWF itself to know which
>> player it was published for? Or a way for a Flash Player 9 SWF to try and
>> access a Flash Player 10 property of some kind that won't return a compile
>> error in the IDE?
>> _______________________________________________
>> Flashcoders mailing list
>> [email protected]
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders