674
Working with External Data
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>
<title>ExternalInterface</title>
<script language="JavaScript">
// Use a variable to reference the embedded SWF file.
var flashVideoPlayer;
/* When the HTML page loads (through the onLoad event of the <body>
tag), it calls the initialize() function. */
function initialize() {
/* Check whether the browser is IE. If so, flashVideoPlayer is
window.videoPlayer. Otherwise, it's document.videoPlayer. The
videoPlayer is the ID assigned to the <object> and <embed> tags. */
var isIE = navigator.appName.indexOf("Microsoft") != -1;
flashVideoPlayer = (isIE) ? window['videoPlayer'] :
document['videoPlayer'];
}
/* When the user clicks the play button in the form, update the
videoStatus text area, and call the playVideo() function within the
SWF file, passing it the URL of the FLV file. */
function callFlashPlayVideo() {
var comboBox = document.forms['videoForm'].videos;
var video = comboBox.options[comboBox.selectedIndex].value;
updateStatus("____" + video + "____");
flashVideoPlayer.playVideo("http://www.helpexamples.com/flash/
video/" + video);
}
// Call the pauseResume() function within the SWF file.
function callFlashPlayPauseVideo() {
flashVideoPlayer.pauseResume();
}
/* The updateStatus() function is called from the SWF file from the
onStatus() method of the NetStream object. */
function updateStatus(message) {
document.forms['videoForm'].videoStatus.value += m "\n";
}
</script>
</head>
<body bgcolor="#ffffff" onLoad="initialize();">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
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...