PDA

View Full Version : flashVars corrupt in IE 8 and 9 ?



glafrance
17 Jul 2012, 4:19 PM
I'm using Ext.flash.Component to display a Flex (Flash) app in an ExtJS 4 app.
I make an ajax call in the ExtJS app, and in the ajax request success handler I assign the response.responseText to a variable in the flashVars for the SWF.

All is fine in Firefox, the xml data gets to the Flex (Flash) app fine, but in Internet Explorer 8 and 9 this is what Flex app receives:

<$xml version=

Here is a snippet of good data (incomplete):

<? xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<SessionData>
<companyData>
<data>
<accountId>4496637</accountMgrId>
<hasSubCompanies>true</hasChildCompanies>
<id>4496637</id>
<modifiedBy>FRENFS</modifiedById>
<modifiedTime>1331890046000</modifiedTime>

Any ideas what's going wrong?
The data is fine is I alert response.responseText. For some reason there is a difference in how the Flex (Flash) app gets the data in IE 8 and 9.

scottmartin
19 Jul 2012, 10:43 AM
Duplicate post in Premium forums.
Did you try encoding as suggestion by Doug in his response?

Scott.

glafrance
19 Jul 2012, 11:13 AM
Yeah, the premium post answer helped. Here's some additional info:

When I first tried this out, the Flex app embedded in ExtJS acted strangely, really slow and not operating correctly. But in the Flex app when I process the data that was encoded with encodeURI() by first calling the decodeURI() Flex function: decodeURI(flashvars.privilegeData) the app worked as expected.

When I switched back to not using decodeURI() on the Flex side, I could not reproduce the slow behavior, even after clearing the browser cache, but as we are using encodeURI() on the ExtJS side its probably best to use decodeURI() on the Flex side.