MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual page 670

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

This JavaScript code defines three methods. The first method returns a reference to the
embedded SWF file based on whether the user's browser is Microsoft Internet Explorer
(IE) or a Mozilla browser. The second function,
that you defined within the Flash document in the previous example. The
parameter in the
the embedded SWF file. If you saved your Flash document with a different name, you
need to change this string to match the values in the object and embed tags. The third
function,
jsFunc()
This function is called from the Flash document when a user clicks the
Button component.
4.
Add the following HTML code before the closing
<form name="outForm" method="POST"
action="javascript:makeCall(document.outForm.outField.value);">
Sending to AS:<br />
<input type="text" name="outField" value="" /><br />
<input type="submit" value="Send" />
</form>
<form name="inForm" method="POST" action="">
Receiving from AS:<br />
<input type="text" name="inField">
</form>
This HTML code creates two HTML forms similar to the forms created in the Flash
environment in the previous exercise. The first form submits the value of the
text field to the
makeCall()
form is used to display a value that gets sent from the SWF file when the user clicks the
instance.
send_button
5.
Save the HTML document and upload both the HTML and SWF files to a web server.
6.
View the HTML file in a web browser, enter a string in the
and click the Send button.
Flash calls the
jsFunc()
field, which displays the contents in the HTML form
7.
Type a value into the
Flash calls the SWF file's
TextInput instance.
670
Working with External Data
function call refers to the object ID and embed name of
thisMovie()
, sets the value of the
JavaScript function defined in an earlier step. The second
JavaScript function and passes the contents of the
HTML text field and click the Send button.
outField
function, which displays the string in the
asFunc()
, calls the
makeCall()
text field in the HTML document.
inField
tag:
</body>
out_ti
inForm inField
method
asFunc()
"extint"
send_button
outField
TextInput instance,
text
out_ti
input text field.
in_ti

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents