|
||||||
|
||||||
Tutorial: Send Information to Flash with JavaScript

Free Flash & JavaScript Tutorial
Method 2 Script << • Back to Tutorial • >>
|
Method 2: An Example of what the HTML webpage script would look like:
<html>
<head>
<title>Send Info To Flash</title>
<script language="javascript" type="text/javascript" src="setvariables.js"></script>
<script language="javascript" type="text/javascript">
function SendMyInfo(){
// Remove the "Please Enter A Message To Be Sent To Flash" if you do not what a default message to appear in the prompt
// The "Enter a number to change the car size and press ok" is the question that you want to prompt the user for an answer to.
// You may change this to anything question you like
var GetMessage = prompt("Enter a number to change the car size and press ok","Please Enter A Message To Be Sent To Flash");
if(GetMessage == null){
//Remove The Line Below If You Do Not Want A Cancel Message Sent To Flash
setFlashVariables('GetInfo','carWidth=100')
}else{
setFlashVariables('GetInfo','carWidth='+GetMessage+'')
}
}
</script>
</head>
<body onLoad="setFlashVariables('GetInfo','text=Hello this is a start up message!');">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" ID="GetInfo" width="410" height="160">
<param name="movie" value="send-info.swf">
<param name="quality" value="high">
<embed NAME="GetInfo" src="send-info.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="410" height="160"></embed>
</object>
<form name="formSendInfo" method="post" action="">
<input type="button" name="Button" value="Click Here To Send Your Own Message To Flash" onClick="SendMyInfo();">
</form>
</body>
</html>
|
Method 2 Script << • Back to Tutorial • >> |
Why not try out webwasp's new community. Meet new people, find friends in your area: Webwasp Mates & Dates
|
|
|

Webwasp is Phil Schulz's baby. You are welcome to contact me or become my Facebook friend:
Click here
All material on this site is protected under international copyright © law. DO NOT reproduce any material from this site without written permission. Please ask as permission is often granted.
|