Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

load text from html form to flash using javascript

Status
Not open for further replies.

leearach2004

Technical User
Dec 8, 2005
86
GB
I have posted this in the flash section to as it covers flash and javascript

Hi there hope somone can help this is realy frustrating me now

I am trying to transfer some text from a html form to a flash movie text area, i havent done thi sbefor ebut i have seen loads of examples on the net and they all say they work but i cant get them 2

my flash file has a:

dynamic text area with the var set to myVar

the code fork the html is below


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns=" xml:lang="en" lang="en">
<head>

<SCRIPT LANGUAGE=JavaScript>
<!--
function doPassVar(args){
var sendText = args.value;
window.document.myFlash.SetVariable("myVar", sendText);
}
//-->
</SCRIPT>



<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>javascript_to_flash</title>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<p>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase=" width="550" height="400" id="myFlash" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="javascript_to_flash.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="javascript_to_flash.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="myFlash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage=" swLiveConnect="true"/>
</object>
</p>
<form name="form1" id="form1" method="post" action="">
<input type="text" name="sendText" maxlength="45" onChange="doPassVar(this)">
</form>
<p>&nbsp;</p>
</body>
</html>


acording to all the tutorials i have read this should run fine. It doesnt through any errors but after typing into the form text box nothing showsup in the flash files as it is surposed to

hope somone can help me its driving me mad

lee
 
Investigate the Flash Integration Kit - it's a whole load of JS routines that let you interact with Flash. I've used it to pass loads of data before.

Hope this helps,
Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Hi there thanks for the reply, where do I get this Flash Integration Kit from and would it need to be installed on every machine I wanted this function to run on.

And can anyone tell me why the code above dosent work as i am asuured it should by microsofts website

thanks lee
 
hi BillyRayPreachersSon

Just check out the flash kit

do you know of any good tutorials on how to use it to transfer data from html to flash

please help

lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top