Click to See Complete Forum and Search --> : switching a call to flash to https: when in a secure connection


schwim
08-02-2008, 12:45 PM
Hi there guys,

When a site goes into a secure connection, a call to a flash file is causing it to show an error(some items are unsecure).

I found this in the Google analytics code:


<script type="text/javascript" language="Javascript1.2">
var gaJsHost = (("https:" == document.location.protocol) ? " https://ssl." : "http://www.");
document.write("<" + "script type='text/javascript' src='" + gaJsHost + "google-analytics.com/ga.js'><" + "/script>");
</script>


and I know it's doing for their code what I want to do for my code, but I'm not sure how to tailor it to my needs, if I can do that at all.

The code I'm having a problem with is:


<MailScannerObject27617 object width="700" height="450" align="middle" id="tandtmain" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">
<param value="sameDomain" name="allowScriptAccess" />

<param value="http://www.tylerandtallulah.com/tandtmain.swf" name="movie" />
<param value="high" name="quality" />
<param value="#666666" name="bgcolor" />
<param value="transparent" name="wmode" />
<embed width="700" height="450" align="middle" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="sameDomain" name="tandtmain" bgcolor="#666666" quality="high" src="http://www.tylerandtallulah.com/tandtmain.swf" />
</object>


Could someone help me with this? I can't use php because it's being entered into a text box(e-commerce backend) that's corrupting/stripping the php out of it.

thanks,
json

leatherback
08-02-2008, 12:52 PM
For sure someone can help you. But as we do not know what exactly your are trying to do, it is impossible to you help you. What does your code look liike?

schwim
08-02-2008, 01:25 PM
You're absolutely right and I'm sorry for forgetting to post it. I've edited the initial post.

thanks,
json

leatherback
08-02-2008, 01:40 PM
I am confused.. You enter the flash code into a text box. And then what? how is it loaded? do you use js to get the textarea content? or do you submit it to the server? (In the first case you need to do a replace in js, in the latter in php)

schwim
08-02-2008, 01:49 PM
Hi there leatherback,

that code is placed in the admin section, via a textbox. After adding the code, it shows up in the shopping cart on the welcome page. I believe I need to use js to attempt the switch, since the TinyMCE editor is allowing me to submit js into the textarea.

I hope this clarifies it somewhat.

thanks,
json

leatherback
08-02-2008, 02:06 PM
sorry to say.. It doesn't. I am still confused...

If it is added to the admin section, don't you do this with php? Can't you just do a preg_replace once submitted? Or when loading. If you are loading over a secure connection, you return it with htpps, else without??