EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - Page 676

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
830 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
676 Working with External Data
The final function, updateStatus(), gets called by the SWF file whenever the video_ns
NetStream objects
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.
NOTE
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.

Table of Contents

Related product manuals