RE: [Flashcoders] Accessing FlashVars
Hi Kerry, Digging a few years back, I unearthed some code. Here's the html: object data=main.swf id=main type=application/x-shockwave-flash width=980 height=600 param name=movie value=main.swf / param name=menu value=false / param name=quality value=best / param name=bgcolor value=#ff / param name=flashVersion value=9 / param name=flashVars value=product=test/ /object And this is from the Main Class constructor: product = root.loaderInfo.parameters.product; For the life of me I can't remember why I used root in a Main constructor (copy-pasta from another class or maybe the movie was loaded by another?), but it worked. Maybe you could try this combo with a bare-bones test movie. (Note: This wasn't done in FlashBuilder, though - Flash IDE compiler with FlashDevelop for code editing) Karina -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry Thompson Sent: 01 May 2012 06:22 To: Flash Coders List Subject: Re: [Flashcoders] Accessing FlashVars That's one way of doing it, but the embed tag has been deprecated. Well, maybe not officially deprecated, but it's considered obsolete. I've done some more digging, and it may not even be related to the FlashVars. There are some other things in the HTML that aren't working, so there may be a deeper, or prior, problem. Thanks, Karl. Cordially, Kerry Thompson On Tue, May 1, 2012 at 1:12 AM, Karl DeSaulniers k...@designdrumm.comwrote: Something like this? object ... param name=FlashVars value=appURL= testappURL2=hello ... embed ... FlashVars=appURL= testappURL2=hello ... / /object FLASH --- function init(e:Event) { var flashVars=this.loaderInfo.**parameters; var appURL=flashVars.appURL; } this.loaderInfo.**addEventListener(Event.**COMPLETE, init); HTH, Karl On Apr 30, 2012, at 5:46 PM, Kerry Thompson wrote: Flash Builder 4 AS3 project, Windows 7, Firefox 12.0. I can't access the FlashVars in the HTML file. I've been working on this all day, and it's driving me crazy (crazier). Do you see anything in the following code? In the constructor of my default AS3 file, I have this: this.loaderInfo.**addEventListener(Event.**COMPLETE, init); and in the init() function: var flashVars:Object; flashVars = this.loaderInfo.parameters; When I look at it in the debugger, flashVars is an object, but it has no parameters. The relevant HTML is pretty straightforward: object classid=clsid:D27CDB6E-AE6D-**11cf-96B8-44455354 width=100% height=100% id=RMK_Beta param name=movie value=RMK_Beta.swf / param name=FlashVars value=appUrl=test / param name=quality value=high / param name=bgcolor value=#ff / param name=allowScriptAccess value=sameDomain / param name=allowFullScreen value=true / !--[if !IE]-- object type=application/x-shockwave-**flash data=RMK_Beta.swf width=100% height=100% param name=FlashVars value=appUrl=test / param name=quality value=high / param name=bgcolor value=#ff / param name=allowScriptAccess value=sameDomain / param name=allowFullScreen value=true / !--![endif]-- !--[if gte IE 6]-- p Either scripts and active content are not permitted to run or Adobe Flash Player version 10.0.0 or greater is not installed. /p !--![endif]-- a href=http://www.adobe.com/go/**getflashplayerhttp://www.adobe.com/go/getfl ashplayer img src= http://www.adobe.com/images/**shared/download_buttons/get_** flash_player.gifhttp://www.adobe.com/images/shared/download_buttons/get_fla sh_player.gif alt=Get Adobe Flash Player / /a !--[if !IE]-- /object !--![endif]-- /object __**_ Flashcoders mailing list Flashcoders@chattyfig.figleaf.**com Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/**mailman/listinfo/flashcodershttp://chattyfig .figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com __**_ Flashcoders mailing list Flashcoders@chattyfig.figleaf.**com Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/**mailman/listinfo/flashcodershttp://chattyfig .figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Accessing FlashVars
Kerry Thompson skriver: That's one way of doing it, but the embed tag has been deprecated. Well, maybe not officially deprecated, but it's considered obsolete. Well, you can't deprecate something that has never been in the standard to begin with. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Accessing FlashVars
Weird because I used to do it that way all the time. Jason Merrill Instructional Technology Architect II Bank of America Global Learning ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry Thompson Sent: Monday, April 30, 2012 8:00 PM To: Flash Coders List Subject: Re: [Flashcoders] Accessing FlashVars Thanks, Karina and Jason. Jason, I've traced out the url, and it's not in that. For the time being, I'm running locally, and the URL just points to the swf. Karina, I've tried it the way you suggest, with no luck. I've looked at loaderInfo.parameters in the debugger, in the constructor, and parameters is an object, but it has no properties. It should have at least one parameter--I'm declaring 5 parameters in the HTML, but it's showing none of them. I'm wondering if the problem has to do with the object's parameters, and not specifically FlashVars. Cordially, Kerry Thompson On Mon, Apr 30, 2012 at 7:27 PM, Karina Steffens kar...@neo-archaic.netwrote: Hey Kerry, I think it's because you assigned the event to loaderinfo - not the Main class instance, and then you're asking for the loaderinfo's loaderinfo, when it's the Main's loaderinfo that you need. Also I don't think you need any event at all. You should be able to access the flashvars from the Main function's constructor (loaderinfo.parameters) Cheers, Karina On 30 Apr 2012, at 23:46, Kerry Thompson al...@cyberiantiger.biz wrote: Flash Builder 4 AS3 project, Windows 7, Firefox 12.0. I can't access the FlashVars in the HTML file. I've been working on this all day, and it's driving me crazy (crazier). Do you see anything in the following code? In the constructor of my default AS3 file, I have this: this.loaderInfo.addEventListener(Event.COMPLETE, init); and in the init() function: var flashVars:Object; flashVars = this.loaderInfo.parameters; When I look at it in the debugger, flashVars is an object, but it has no parameters. The relevant HTML is pretty straightforward: object classid=clsid:D27CDB6E-AE6D-11cf-96B8-44455354 width=100% height=100% id=RMK_Beta param name=movie value=RMK_Beta.swf / param name=FlashVars value=appUrl=test / param name=quality value=high / param name=bgcolor value=#ff / param name=allowScriptAccess value=sameDomain / param name=allowFullScreen value=true / !--[if !IE]-- object type=application/x-shockwave-flash data=RMK_Beta.swf width=100% height=100% param name=FlashVars value=appUrl=test / param name=quality value=high / param name=bgcolor value=#ff / param name=allowScriptAccess value=sameDomain / param name=allowFullScreen value=true / !--![endif]-- !--[if gte IE 6]-- p Either scripts and active content are not permitted to run or Adobe Flash Player version 10.0.0 or greater is not installed. /p !--![endif]-- a href=http://www.adobe.com/go/getflashplayer; img src= http://www.adobe.com/images/shared/download_buttons/get_flash_player .gif alt=Get Adobe Flash Player / /a !--[if !IE]-- /object !--![endif]-- /object ___ 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 -- This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you are not an intended recipient, please notify the sender, and then please delete and destroy all copies and attachments, and be advised that any review or dissemination of, or the taking of any action in reliance on, the information contained in or attached to this message is prohibited. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an
Re: [Flashcoders] Accessing FlashVars
Back in the day I remember embed just plain old worked better across the board in non-IE browsers. That may have changed (object offered better fallbacks for one thing, and has been worked on a lot more lately, but it also had other kinds of problems). Then we came up with this nested object thing that has conditional comments, and duplicates of all the params, and called that standards. Then HTML5 embraced tag soup again, arbitrary tag names, and now even arbitrary attributes names, so using embed with random attributes is actually standards compliant, but is still considered deprecated whatever that means anymore. And embed still works better and is less verbose, afaict. /bitter-lament Kevin N. On 5/1/2012 1:21 AM, Kerry Thompson wrote: That's one way of doing it, but the embed tag has been deprecated. Well, maybe not officially deprecated, but it's considered obsolete. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders