Query String Variables

IE not loading swf....

Page 1 of 1

8 Replies - 16899 Views - Last Post: 26 October 2005 - 11:29 PM

#1 theRemix  Icon User is offline

  • D.I.C Regular

Reputation: 15
  • View blog
  • Posts: 440
  • Joined: 19-October 05

Query String Variables

Posted 24 October 2005 - 02:35 PM

I have a swf that loads many variables from query string:

(snippet includes autogenerated flash version detector)
if(hasRightVersion) {  // if we've detected an acceptable version
    var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
    + 'width="600" height="450"'
    + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
    + '<param name="movie" value="preview.swf?variable1=value1&variable2=value2" /><param name="quality" value="high" /><param name="bgcolor" value="#666666" />'
    + '<embed src="picPreview.swf?variable1=value1&variable2=value2" quality="high" bgcolor="#666666" '
    + 'width="600" height="450" name="picPreview" align="middle"'
    + 'play="true"'
    + 'loop="false"'
    + 'quality="high"'
    + 'allowScriptAccess="sameDomain"'
    + 'type="application/x-shockwave-flash"'
    + 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
    + '<\/embed>'
    + '<\/object>';
    document.write(oeTags);   // embed the flash movie
  } else {  // flash is too old or we can't detect the plugin
    var alternateContent = 'Alternate HTML content should be placed here.'
 	 + 'This content requires the Macromedia Flash Player.'
    + '<a href=http://www.macromedia.com/go/getflash/>Get Flash</a>';
    document.write(alternateContent);  // insert non-flash content
  }


while this works great with firefox/mozilla the swf does not load in IE, unless there are no values (variables=&variables=&variables=)

anybody have a clue as to why this works? some activeX controls of some sort? i hate IE :(

Is This A Good Question/Topic? 0
  • +

Replies To: Query String Variables

#2 pioSko  Icon User is offline

  • still.dreaming
  • member icon

Reputation: 23
  • View blog
  • Posts: 1,888
  • Joined: 06-June 03

Re: Query String Variables

Posted 24 October 2005 - 11:51 PM

wow.. looks fine to me... would need some further testing I guess. Try just the embed code code with swf and variables.. nothing else.
Was This Post Helpful? 0
  • +
  • -

#3 theRemix  Icon User is offline

  • D.I.C Regular

Reputation: 15
  • View blog
  • Posts: 440
  • Joined: 19-October 05

Re: Query String Variables

Posted 26 October 2005 - 01:51 AM

ok i tried it. tried to get the problem isolated to whatever part of the code wasn't working. but taking everything out except the embed tag had the same results. coud it be a problem with IE and the query string? is there a limit to the query string? i used php's urlencode() on each part of the query string, so i should be safe there, but is there a limit on its entire length? an average query string can be 3,321 characters (many variables) including ...'s (i believe they are ok, otherwise urlencode() would have converted it right?) and can get up to 5,000 characters easy. could this be a problem?





(sorry for my long sentences, i hope anyone reading can understand.) :P
Was This Post Helpful? 0
  • +
  • -

#4 pioSko  Icon User is offline

  • still.dreaming
  • member icon

Reputation: 23
  • View blog
  • Posts: 1,888
  • Joined: 06-June 03

Re: Query String Variables

Posted 26 October 2005 - 02:02 AM

Don't worry about long sentences.. the more you explain the better :P

Long variables aren't a problem either. I've used MUCH longer variable strings that what you have shown here and everything worked fine.

Post a zip file with examples shown and I'll test it out on my machine. (If you do not wish to post it, send it to me by email: piosko@gmail.com).
Was This Post Helpful? 0
  • +
  • -

#5 theRemix  Icon User is offline

  • D.I.C Regular

Reputation: 15
  • View blog
  • Posts: 440
  • Joined: 19-October 05

Re: Query String Variables

Posted 26 October 2005 - 03:01 AM

k i sent you test.zip
its weird because when i tested it on my desktop IE loaded it fine!, aww crap i forgot to send you the .fla (sending it now....)

but when the swf and the html are on a server, IE never finishes loading it. it doesn't act the same way as it does on local machine...
Was This Post Helpful? 0
  • +
  • -

#6 pioSko  Icon User is offline

  • still.dreaming
  • member icon

Reputation: 23
  • View blog
  • Posts: 1,888
  • Joined: 06-June 03

Re: Query String Variables

Posted 26 October 2005 - 04:55 AM

The problem is somewhere in the string you're trying to send to flash. I shortened it to just one variable and it worked fine. There may be a weird character or orther element that's causing the trouble... or the string maybe too long. I saw that, with the original string, IE kept trying to load something.

Check your string.

However, the information you are trying to send to flash, where will it come from and how is it going to be processed? Is it coming from a mysql database through PHP? Or Are you reading a txt file? or other?

I'm thinking here that an XML file would suit you more. Organising all that data into an XML file which can then be loaded by Flash, not fed into it.
Was This Post Helpful? 0
  • +
  • -

#7 theRemix  Icon User is offline

  • D.I.C Regular

Reputation: 15
  • View blog
  • Posts: 440
  • Joined: 19-October 05

Re: Query String Variables

Posted 26 October 2005 - 05:08 AM

yeah i used an XML file originally (generated by php+mysql), but maybe you've seen that, this is for a 'preview' of the main content, so, i guess i'm just too lazy to script another xml file just for a preview, i thought the query string would be a faster solution. it worked in firefox!

but wait, i don't know how what i need can be accomplished...

the original file is a swf that calls a php file(xml) and loads the data, this is ok.
but from this file, i pass variables (POST) to a preview.swf, this preview.swf needs to take the POST vars and display them.

theres no xml file that it can read from...

so a .swf needs to pass many variables with urlencoded strings as values to another .swf ... is this possible through loading an XML file?

the only way i can think of is, when the original .swf Submits data(POST) it writes the data to a temporary file in XML format, and sends one variable to the preview.swf, which would be the temporary.xml file's URL... still this seems far-fetched to me. i don't think i can pull it off.

what do you think?
Was This Post Helpful? 0
  • +
  • -

#8 theRemix  Icon User is offline

  • D.I.C Regular

Reputation: 15
  • View blog
  • Posts: 440
  • Joined: 19-October 05

Re: Query String Variables

Posted 26 October 2005 - 08:09 AM

ok i got it.

for some odd reason, IE did not like a long string appended to its embedded url tag.

so where i used to do:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="600" height="450" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">
<param name="movie" value="myFlash.swf[b]?variable1=value1&variable2=value2[/b]" /><param name="quality" value="high" /><param name="bgcolor" value="#FFFFFF" />
<embed src="myFlash.swf[b]?variable1=value1&variable2=value2[/b]" quality="high" bgcolor="#FFFFFF" width="600" height="450" name="myFlash" align="middle" play="true" loop="false" quality="high" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</embed>
</object>


i found in macromedia site, http://www.macromedi...cfm?id=tn_16417 that flash after version 6 accepts this way of using flash vars:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="600" height="450" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">
<param name="movie" value="myFlash.swf" />
[b]<param name ="FlashVars" value="variable1=value1&variable2=value2" />[/b]<param name="quality" value="high" /><param name="bgcolor" value="#FFFFFF" />
<embed src="myFlash.swf" [b]FlashVars="variable1=value1&variable2=value2"[/b] quality="high" bgcolor="#FFFFFF" width="600" height="450" name="myFlash" align="middle" play="true" loop="false" quality="high" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</embed>
</object>


this way works great in moz && ie

thanks for all your help, believe it or not, i couldn't have finished this without you.... and its 5:03 now, i can sleep, my boss wakes up in 2 hours, i can show him some finished product... finally.. thanks again.
Was This Post Helpful? 0
  • +
  • -

#9 pioSko  Icon User is offline

  • still.dreaming
  • member icon

Reputation: 23
  • View blog
  • Posts: 1,888
  • Joined: 06-June 03

Re: Query String Variables

Posted 26 October 2005 - 11:29 PM

That's what we're here for :)

Good to hear it's working fine... and sorry, I should have remembered the FlashVars thing earlier.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1