PDA

View Full Version : Sending Text to swf from Javascript


Blackthorn
01-03-2006, 11:43 AM
Happy new year folks, now to kick the year off I have the following:
Its a simple swf which wants to recieve and display text from a javascript button. :( I can't get it too work. Any help.

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

<script language="JavaScript">
<!-- no script
function changetext(str)
{
document.getElementById( "TextTest" ).setVariable( "myText", str);
}
-->
</script>


<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>TextTest</title>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<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="100" height="50" id="TextTest" swLiveConnect=true align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="TextTest.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="TextTest.swf" quality="high" bgcolor="#ffffff" width="100" height="50" name="TextTest" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

<input type="button" value="Java to Flash" name="Java to Flash" onclick="changetext('somthing')";>

</body>
</html>

autoportret
01-06-2006, 03:07 PM
hi

try to make it with SetVariable instead of setVariable
javascript is casesensitive so...