-
29 Jul 2009 1:07 PM #1
[TENT][3.0.0] Fix: Ext.FlashComponent pass parameters to swfobject
[TENT][3.0.0] Fix: Ext.FlashComponent pass parameters to swfobject
Hi all,
I love the Ext.FlashComponent already
But I wanted to pass in extra parameters to the swf file, and since I discovered ext uses swfobject, I knew it was possible. So with the fix below in the Ext.FlashComponent's onRender method, I can use:
In Actionscript 3, now you can use:Code:var movie = new Ext.FlashComponent({ url : '/movie.swf', flashVars: { myParameter: 'a value', anotherOne: 2 } });
root.loaderInfo.parameters.myParameter (='a value') and root.loaderInfo.parameters.anotherOne (=2)
Best regards,Code:onRender : function(){ Ext.FlashComponent.superclass.onRender.apply(this, arguments); var params = { allowScriptAccess: 'always', bgcolor: this.backgroundColor, wmode: this.wmode }, vars = Ext.apply(this.flashVars||{},{ allowedDomain: document.location.hostname, elementID: this.getId(), eventHandler: 'Ext.FlashEventProxy.onEvent' }); new swfobject.embedSWF(this.url, this.id, this.swfWidth, this.swfHeight, this.flashVersion, this.expressInstall ? Ext.FlashComponent.EXPRESS_INSTALL_URL : undefined, vars, params); ... },
RonaldoRonald van Raaphorst aka Ronaldo
I'm a freelance software developer in Java, PHP, and ExtJs.
Skyperonald_twensoc
Mailinfo@twensoc.nl
-
29 Jul 2009 5:55 PM #2
Fixed in SVN.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
29 Jul 2009 6:10 PM #3
I'm swf ignorant. There's no need to also do similar with the params also?
MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
30 Jul 2009 12:19 AM #4
Hi,
I'm not sure if being able to change the params variable is valuable too. Heck, it might be usefull to be able to override all parameters.
Search for 'swfobject.embedSWF' in the swfobject API docs,
in my standalone swfobject usage, I used the flashvars parameter to pass information to the flash file, and that works.
RonaldoRonald van Raaphorst aka Ronaldo
I'm a freelance software developer in Java, PHP, and ExtJs.
Skyperonald_twensoc
Mailinfo@twensoc.nl
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote