I don't know javascript very well, so I thought I'd put a simple question to you all. First, let me explain what I'm trying to do. I'm sending variables from Flash to Javascript, and then I want to send those variables right back to Flash. I followed a tutorial on macromedia's site on how to do this, and the variables are sending from Flash to Javascript just fine, but they don't seem to be sending back to Flash.
Here's the tutorial I used:
<!-- m --><a class="postlink" href="http://www.macromedia.com/support/flash/ts/documents/java_script_comm.htm#jtfc">http://www.macromedia.com/support/flash ... m.htm#jtfc</a><!-- m -->
The problem is that I don't want to use a text field to get the variable to send back to Flash, I just want to resend the same one back. Is there a simple way to rewrite this code to work without a text field?
Excerpted for your ease:
In <HEAD>:
<SCRIPT LANGUAGE=JavaScript>
<!--
function doPassVar(args){
var sendText = args.value;
window.document.myFlash.SetVariable("wantSound", sendText);
alert (args);
}
//-->
</SCRIPT>
In <BODY>:
<form name="form1" onSubmit="doPassVar(sendText);" action="#">
<input type="text" name="sendText" maxlength="45" onChange="doPassVar(this);">
</form>
Thanks in advance for your help!
Here's the tutorial I used:
<!-- m --><a class="postlink" href="http://www.macromedia.com/support/flash/ts/documents/java_script_comm.htm#jtfc">http://www.macromedia.com/support/flash ... m.htm#jtfc</a><!-- m -->
The problem is that I don't want to use a text field to get the variable to send back to Flash, I just want to resend the same one back. Is there a simple way to rewrite this code to work without a text field?
Excerpted for your ease:
In <HEAD>:
<SCRIPT LANGUAGE=JavaScript>
<!--
function doPassVar(args){
var sendText = args.value;
window.document.myFlash.SetVariable("wantSound", sendText);
alert (args);
}
//-->
</SCRIPT>
In <BODY>:
<form name="form1" onSubmit="doPassVar(sendText);" action="#">
<input type="text" name="sendText" maxlength="45" onChange="doPassVar(this);">
</form>
Thanks in advance for your help!