[Flashcoders] Detect player version that was published
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 Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Detect player version that was published
You could test for a known bug that for backwards compability is still kept in new players. Test if calling gotoAndStop actually instantiates the timeline instances right there or if it is delayed. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Detect player version that was published
On 24/08/2010 15:04, Todd Dominey 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 Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/Capabilities.html?allClasses=1#version ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Detect player version that was published
I wasn't going to suggest a known bug, I was just going to suggest looking for features that were included in a revision; yet, I like yours better. On 8/24/2010 10:14 AM, Henrik Andersson wrote: You could test for a known bug that for backwards compability is still kept in new players. Test if calling gotoAndStop actually instantiates the timeline instances right there or if it is delayed. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Detect player version that was published
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 flashcod...@domineydesign.com 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 Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Detect player version that was published
Right, not looking for the Flash Player plugin version a user has installed, but rather which runtime the SWF was published to (9 or 10). The root of my dilemma is that Flash's behavior when applying an alpha tween to a Sprite containing a text field using system typefaces isn't consistent when publishing to FP9 and FP10. When FP9 is the runtime, the text fields aren't tweened as part of the parent. When FP10 is the runtime, they are. Note that this is independent of the Flash Player plugin a user has installed. If you compile the SWF with FP9 as the runtime and load it in FP10 in the browser, the text fields aren't tweened. Compile to FP10 and load in FP10, they are. So...I'm trying to find something that an AS3 SWF could look for to know whether FP10 was selected as its runtime when published. If I knew that, I could code around it to control how that tween behavior is handled. Todd On Aug 24, 2010, at 10:25 AM, Glen Pike wrote: On 24/08/2010 15:04, Todd Dominey 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 Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Sorry, was a bit fast off the mark there, but you could leverage the FP version to decide whether to implement certain features regardless of whether the publisher published to Flash 9 or 10 - if the runtime is FP10, then I guess it's up-to-you to do stuff and also whether to expose certain API's to the publisher? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Detect player version that was published
On 24/08/2010 15:36, Todd Dominey wrote: Right, not looking for the Flash Player plugin version a user has installed, but rather which runtime the SWF was published to (9 or 10). The root of my dilemma is that Flash's behavior when applying an alpha tween to a Sprite containing a text field using system typefaces isn't consistent when publishing to FP9 and FP10. When FP9 is the runtime, the text fields aren't tweened as part of the parent. When FP10 is the runtime, they are. Note that this is independent of the Flash Player plugin a user has installed. If you compile the SWF with FP9 as the runtime and load it in FP10 in the browser, the text fields aren't tweened. Compile to FP10 and load in FP10, they are. So...I'm trying to find something that an AS3 SWF could look for to know whether FP10 was selected as its runtime when published. If I knew that, I could code around it to control how that tween behavior is handled. Todd You could look into conditional compilation which is available in CS4+ I think: http://www.google.co.uk/#hl=enq=flash+ide+conditional+compilingaq=faqi=aql=oq=gs_rfai=fp=67d5d5d61e9a0270 http://www.google.co.uk/#hl=enq=flash+ide+conditional+compilingaq=faqi=aql=oq=gs_rfai=fp=67d5d5d61e9a0270 Glen ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Detect player version that was published
On 24/08/2010 15:04, Todd Dominey 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 Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Sorry, was a bit fast off the mark there, but you could leverage the FP version to decide whether to implement certain features regardless of whether the publisher published to Flash 9 or 10 - if the runtime is FP10, then I guess it's up-to-you to do stuff and also whether to expose certain API's to the publisher? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Detect player version that was published
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 flashcod...@domineydesign.com 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 Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Detect player version that was published
Right, not looking for the Flash Player plugin version a user has installed, but rather which runtime the SWF was published to (9 or 10). Then I think you should go with Zeh's suggestion: http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/display/LoaderInfo.html#swfVersion http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/display/LoaderInfo.html#swfVersionChecking if Loader has an unloadAndStop method defined will let you know if the player version is = 10, but not what version the swf was published for. Cheers Juan Pablo Califano 2010/8/24 Todd Dominey flashcod...@domineydesign.com Right, not looking for the Flash Player plugin version a user has installed, but rather which runtime the SWF was published to (9 or 10). The root of my dilemma is that Flash's behavior when applying an alpha tween to a Sprite containing a text field using system typefaces isn't consistent when publishing to FP9 and FP10. When FP9 is the runtime, the text fields aren't tweened as part of the parent. When FP10 is the runtime, they are. Note that this is independent of the Flash Player plugin a user has installed. If you compile the SWF with FP9 as the runtime and load it in FP10 in the browser, the text fields aren't tweened. Compile to FP10 and load in FP10, they are. So...I'm trying to find something that an AS3 SWF could look for to know whether FP10 was selected as its runtime when published. If I knew that, I could code around it to control how that tween behavior is handled. Todd On Aug 24, 2010, at 10:25 AM, Glen Pike wrote: On 24/08/2010 15:04, Todd Dominey 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 Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Sorry, was a bit fast off the mark there, but you could leverage the FP version to decide whether to implement certain features regardless of whether the publisher published to Flash 9 or 10 - if the runtime is FP10, then I guess it's up-to-you to do stuff and also whether to expose certain API's to the publisher? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders