Trouble getting flash Embed to display while browsing locally (file:/// etc) in Firefox

Hey all,  

      The following code embeds a flash movie into an html document.  The javascript nested inside this object tag allows me to pass the URL scope variables in as variables to the flash movie (searchString is the URL scope variables) in case you were wondering what thats about.

Now,  this code works fine when browsed to via a server (http://localhost/myDir/thisfile.html)  but doesn't work if browsed to locally (file:///C:/myDir/thisfile.html).  

Due to the unique circumstances of my project; I need this to be able to work when browsed to locally; does anyone have an idea of how I can proceed?    Thank you very much.  
----------------

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="1280" height="768" id="PaxMaster" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="PaxMaster.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />

  <script type="text/javascript">
 
  document.write('<embed src="PaxMaster.swf' + searchString + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" name="PaxMaster" align="middle" allowScriptAccess="sameDomain" width="1280" height="768"</embed>');
 
  </script>
 
</object>

-------------------------
LVL 1
andrewaielloAsked:
Who is Participating?
 
ZvonkoSystems architectCommented:
Perhapse force the URL to be a queryString by adding a question mark charcter hardcoded:
searchString = searchString.substr(1);
document.write('<embed src="PaxMaster.swf?' + escape(searchString) + '" ...

0
 
Michel PlungjanIT ExpertCommented:
You mean it works
http://localhost/myDir/thisfile.html?parms
but doesn't work if browsed to locally
file:///C:/myDir/thisfile.html?parms

that is due to some browser setups (IE especially) does not see the query string from harddisk...
I do not have a suggestion
0
 
andrewaielloAuthor Commented:
A few notes:

I must be using Firefox

and the PaxMaster.swf is in the same directory as this file.
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
andrewaielloAuthor Commented:
Yes, that is correct.
0
 
andrewaielloAuthor Commented:
I am not sure if that is the only problem because if I drop the paramaters from this  http://localhost/myDir/thisfile.html?parms    the swf will still embed (the screen will go black)  it just doesn't do anything else.    

However if I drop the params from file:///C:/myDir/thisfile.html?parms   the screen doesn't even go blank; the embed doesn't happen at all.
0
 
thirdCommented:
how do you get your searchstring when browsing locally? maybe you are getting an invalid value.
0
 
andrewaielloAuthor Commented:
The search string is acquired by the javascript:

searchString = document.location.search;


If this is a problem, I'm not sure if it can be the only one (by the logic of the screen not turning black in my previous post).   Thanks.
0
 
andrewaielloAuthor Commented:
Hmm...this may in fact be the key problem.  I just made a simple html file with a flash embed (no searchstrings or anything)  and it work both ways (local and server),
0
 
Michel PlungjanIT ExpertCommented:
Try saving this on your harddisk

<script>
alert(location.href+'\n'+((location.search)?location.search.substring(1):'nothing passed'))
</script>
<a href="#" onClick="this.href=location.href.split('?')[0]+'?parm=parm1'">Try</a>
0
 
Michel PlungjanIT ExpertCommented:
I have this url:
file:///c:/temp/testpassed.html?parm=parm1
0
 
andrewaielloAuthor Commented:
Yes I get the same thing.. that seems good.


In my original file I put some code to ALERT the searchString; and it did in fact work when browsed locally...but it changed it, like it added the special characters for & and such; maybe thats what messed it up?


 
0
 
Michel PlungjanIT ExpertCommented:
Sorry, your comment does not enlighten me :(
0
 
andrewaielloAuthor Commented:
Okay Basically here is the situation:

1)  I've determined that an embeded flash movie will display no problem if you browse to the file locally or from a server

2)  I've determined that the searchString actually does come in okay locally or from a server

3)  My file doesn't work... which is a flash movie embeded with the searchString passed in as an argument.....and based on 1) and 2).... I have no idea why!
0
 
ZvonkoSystems architectCommented:
Can you please escape() you searchString:
alert(searchString);
document.write('<embed src="PaxMaster.swf' + escape(searchString) + '" ...


0
 
andrewaielloAuthor Commented:
Okay i changed the embed to:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="1280" height="768" id="PaxMaster" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="PaxMaster.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />

  <script type="text/javascript">
 
  alert(searchString);
  document.write('<embed src="PaxMaster.swf' + escape(searchString) + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" name="PaxMaster" align="middle" allowScriptAccess="sameDomain" width="1280" height="768"</embed>');
 
  </script>
 
</object>

-------------

This didn't change the behavior at all, still doesn't work

I tried it with searchString = window.location.search;  and searchString = document.location.search.


The URL it bounces too is (and the one it alerts)  is:

file:///C:/CFusionMX/wwwroot/PaxLive/testSchedule.html?slideNum=3&amp;slide1=PaxSlide1.swf&amp;slide2=PaxSlide2.swf&amp;slide3=PaxSlide3.swf&amp;slide4=&amp;slide5=

(notice it adds the strange characters)


Now, even if just hand-type the right stuff in the url box and hit enter (as in:  file:///C:/CFusionMX/wwwroot/PaxLive/testSchedule.html?slideNum=3&slide1=PaxSlide1.swf&slide2=PaxSlide2.swf&slide3=PaxSlide3.swf&slide4=&slide5= )

It still doesn't work.    Pretty stumped.  Thanks.  
0
 
ZvonkoSystems architectCommented:
Add that question mark character please:

alert(searchString);
  document.write('<embed src="PaxMaster.swf?' + escape(searchString) + '"


0
 
andrewaielloAuthor Commented:
Tried that;  No effect.
0
 
andrewaielloAuthor Commented:
Could be something about that complicated embed tag thats messing things up...  I tried swapping out the whole object tag for this:  

object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="1280" height="768" id="PaxMaster" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="PaxSlide3.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />

  <embed src="PaxSlide3.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="1280" height="768"></embed>
 
</object>

-----     (PaxSlide3.swf is a dummy movie).    

And that at least embedded.
0
 
andrewaielloAuthor Commented:
On a whim I tried changing the document.write embed part to window.write  but that did nothing too.
0
 
andrewaielloAuthor Commented:
Ya know... I think the Div above the embed might be somehow nullifying it:   When i removed the DIV it seemed that the embed happened (the screen became scrollable horizontally and vertically (the flash file is large)...but  from our earlier question we noticed that the values read in from the file dont come in unless the  div is there.....

<div id="txt"></div>
 <div id="theExample">Loading...</div>


<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="1280" height="768" id="PaxMaster" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="PaxMaster.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />

  <script type="text/javascript">
 
  alert(searchString);
  document.write('<embed src="PaxMaster.swf' + escape(searchString) + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" name="PaxMaster" align="middle" allowScriptAccess="sameDomain" width="1280" height="768"</embed>');
 
  </script>
 
</object>
0
 
ZvonkoSystems architectCommented:
Get PageSpy and look your page construction in IE briwser.
When you get your script right then switch back to Mozilla.
Here is the PageSpy: http:/M_1344026.html

0
 
andrewaielloAuthor Commented:
Okay, btw i noticed something that seems Key to figuring this out:  

When the page first loads as in:  file:///C:/CFusionMX/wwwroot/PaxLive/testSchedule.html      the embed is actually there (for a split second)   but when it redirects to the same page with anything at all in the url scope  (for example file:///C:/CFusionMX/wwwroot/PaxLive/testSchedule.html?hey)  the embed does not show up.
0
 
andrewaielloAuthor Commented:
Thats why when i took the div out I saw the embed (because the redirection couldn't happen without the div)
0
 
ZvonkoSystems architectCommented:
That div was only for testint. Remove that one statement that assigns innerHTML to that div and you can go on without script erors. That div is NOT necessery for execution, only for visaul test.

0
 
andrewaielloAuthor Commented:
K, i removed the line:  document.getElementById('theExample').innerHTML=responseText;    in the function  PostFileReady

and those two Div lines.    I am now looking at that pagespy thing.  

Did my recent observation spark any ideas, btw?
0
 
andrewaielloAuthor Commented:
Okay, I was using the PageSpy, and I'm not really sure what I am supposed to be doing with it.  I've been looking through all the page information and nothing seems to be jumping out as an error:

https://ssl117.alentus.com/jkingsweb/gbt/PaxTest/testSchedule.html?tsdg

(i just put that  ?tsdg at the end to prevent the redirect)
0
 
andrewaielloAuthor Commented:
When I click on the "this" tap of PageSpy it shows some flickering, and then freezes up.  
0
 
andrewaielloAuthor Commented:
Further narrowing it down....

If I change this:  

 " document.write('<embed src="PaxMaster.swf' + escape(searchString) + '" pluginspage...."

to this:

  " document.write('<embed src="PaxMaster.swf' + "" + '" pluginspage...."

(just knocking out the searchString part); the embed happens (after the redirect as well as before)... but of course the embeded flash file can't do anything useful because it needs those values from the searchString.    

At least its really narrowed down now...
0
 
ZvonkoSystems architectCommented:
OK, two observations:
1.) The allert() does NOT happen, that mean script is not executed at all. Because <script> cannot be inside <object> </object> section.
2.) You have several pages, but changed only some to my textFile method.

For the first you have to put all HTML for the <object> to String and add to that string the searcgString parts and write then the complette <object> at once to the page.

0
 
andrewaielloAuthor Commented:
Hmm,

1)  my alerts happen... which alert are you talking about?

2)  i should only have this one page: testSchedule.html  that reads in the text file testValues.txt and embeds the PaxMaster.swf file.... what other page are you referring to?



I have some more observations on my end....

It seems that there is indeed a problem with the way that escape(searchString) is interpreted because if I just hardcode the information,   as in just putting:

document.write('<embed src="PaxMaster.swf' + "?slideNum=3&slide1=smoothie1.swf&slide2=smoothie2.swf&slide3=leonidas.jpg&slide4=&slide5="+ '" plug

It works.     Now; this information:  
?slideNum=3&slide1=smoothie1.swf&slide2=smoothie2.swf&slide3=leonidas.jpg&slide4=&slide5=
should be what is coming in via the searchString...but apparently its getting messed around with in some way??   Thanks again; sorry this is so complicated!!!
0
 
ZvonkoSystems architectCommented:
When I click on uper URL then I see no alert()
Do you see alert when you open this:
https://ssl117.alentus.com/jkingsweb/gbt/PaxTest/testSchedule.html?tsdg

Show me one URL that we bot can observe and where you do the changes.

0
 
andrewaielloAuthor Commented:
I got it working!   Thanks for your assistance again!   Now... I suspect there might be one more issue relating to this, so I'll leave the topic open for now.   Thanks again!!!
0
 
ZvonkoSystems architectCommented:
You are welcome.
0
 
andrewaielloAuthor Commented:
Damn; that problem I was worried about occurred.  It seems that when the .swf file is transferred via FTP something is slightly changed and it doesn't work.  To clarify, if I download the swf from a browser and run it (through that testSchedule.html stuff)  it works.  But if the same exact file is instead transferred via FTP; it doesn't work.  Have you ever heard of something like this?
0
 
ZvonkoSystems architectCommented:
Yeap!
FTP works in either of two transfer modes: ASCII or BINARI (binary or IMAGE) mode.
Default FTP transfer mode is ASCII for text transfer to convert line break correctly betwean DOS and Unix or Mainframe systems. But that text conversion destroys your binary image of the flash.
So before transfer you have to switch the transfer mode to BINARY.
On Windows FTP is the line command for that switch to BINARY transfer mode: binary


0
 
andrewaielloAuthor Commented:
Good advice;  Unfortunately I already tried both Binary and Ascii modes..
0
 
andrewaielloAuthor Commented:
I'll close out this topic; but the other issue is here:  http://www.experts-exchange.com/Networking/Protocols/Application_Protocols/FTP/Q_22755336.html

Driving me nuts...just got off a 2 hour conference call with this a-hole IT lord talking down to me...but he couldn't figure it out either.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.