Passing a value from jscript to html

J

Jake G

I have a flash word verification doohickey running on a page that
submits an email (problem with a spammer).

The code for the flash is......

<td width="109"> <div id="flashcontent">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
width="80" height="40" id="accesscode" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="accesscode.swf?gifFile=123456"/>
<param name="quality" value="high" />
<param name="bgcolor" value="#000000" />
<embed src="accesscode.swf" quality="high" bgcolor="#ffffff" width="80"
height="40" name="accesscode" align="middle"
allowScriptAccess="sameDomain" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

I need to pass it the currently hardcoded 123456 number. I want to
pass it something like

<script type="text/javascript">
var numbers = Math.round(Math.random()*99999);
</script>
I cannot just set gifFile = numbers, it is null.
How do I pass the variable numbers to the flash program?
 
R

Randy Webb

Jake G said the following on 11/7/2006 10:09 AM:
I have a flash word verification doohickey running on a page that
submits an email (problem with a spammer).

The code for the flash is......

<td width="109"> <div id="flashcontent">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
width="80" height="40" id="accesscode" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="accesscode.swf?gifFile=123456"/>
<param name="quality" value="high" />
<param name="bgcolor" value="#000000" />
<embed src="accesscode.swf" quality="high" bgcolor="#ffffff" width="80"
height="40" name="accesscode" align="middle"
allowScriptAccess="sameDomain" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

I need to pass it the currently hardcoded 123456 number. I want to
pass it something like

<script type="text/javascript">
var numbers = Math.round(Math.random()*99999);
</script>
I cannot just set gifFile = numbers, it is null.
How do I pass the variable numbers to the flash program?

document.write the entire object element and then insert the random
number where the 123456 is at. Something like this:

document.write('<object............>')
document.write('<parame name="movie" value="accesscode.swf?gifFile=' +
Random(9999) + '">')

Where Random is the Random function from the group FAQ.

function Random(x) { return Math.floor(x*Math.random()) }
 
J

Jake G

group FAQ???

Randy said:
Jake G said the following on 11/7/2006 10:09 AM:

document.write the entire object element and then insert the random
number where the 123456 is at. Something like this:

document.write('<object............>')
document.write('<parame name="movie" value="accesscode.swf?gifFile=' +
Random(9999) + '">')

Where Random is the Random function from the group FAQ.

function Random(x) { return Math.floor(x*Math.random()) }

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
 
R

Randy Webb

Jake G said the following on 11/7/2006 2:16 PM:
group FAQ???

Yeah, the one in my signature that also explains about top-posting and
interleaving your replies.
 
R

Randy Webb

Jake G said the following on 11/8/2006 9:52 AM:
Oh ok. Sorry that was a stupid question :)

Forgiveness is forthcoming, it will only cost you your first three
newborn children, a left arm, a right foot and an ear lobe. The ear lobe
is interest on having to wait for payment :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top