676
Working with External Data
The final function,
updateStatus()
, gets called by the SWF file whenever the
video_ns
NetStream object’s
onStatus
event handler is triggered. This HTML code also defines a
form that has a combo box of videos that the user can choose from. Whenever the user
selects a video and clicks the play button, the
callFlashPlayVideo()
JavaScript function
is called, which then calls the
playVideo()
function within the SWF file. This function
passes the URL of the SWF file to load into the video instance. As the video plays back
and the NetStream object’s status changes, the contents of the HTML text area on the
Stage are updated.
4.
Save your changes to the HTML document, and then upload both the HTML and SWF
files to a website.
5.
Open the remote video.html document from the website, select a video from the combo
box, and click the play button.
Flash plays the selected FLV file and updates the contents of the videoStatus text area
within the HTML document.
You can find the sample source file, external.fla, in the Samples folder on your hard disk.
■
In Windows, browse to
boot drive
\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\ActionScript\ExternalAPI.
■
On the Macintosh, browse to
Macintosh HD
/Applications/Macromedia Flash 8/Samples
and Tutorials/Samples/ActionScript/ExternalAPI.
For more information on the External API, see
ExternalInterface
(flash.external.ExternalInterface)
in the
ActionScript 2.0 Language Reference
.
For more information on local file security, see
“About local file security and Flash Player”
on page 679
.
NO
T
E
Avoid using other methods of accessing the plug-in object, such as
document.getElementById("pluginName") or document.all.pluginName, because these
other methods do not work consistently across all browsers.
Summary of Contents for FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
Page 1: ...Learning ActionScript 2 0 in Flash...
Page 8: ...8 Contents...
Page 18: ...18 Introduction...
Page 30: ...30 What s New in Flash 8 ActionScript...
Page 66: ...66 Writing and Editing ActionScript 2 0...
Page 328: ...328 Interfaces...
Page 350: ...350 Handling Events...
Page 590: ...590 Creating Interaction with ActionScript...
Page 710: ...710 Understanding Security...
Page 730: ...730 Debugging Applications...
Page 780: ...780 Deprecated Flash 4 operators...
Page 830: ...830 Index...