638
Working with External Data
3.
Select Control > Test Movie to test the Flash document.
As the external XML file loads, the nested
bar_mc
movie clip resizes to display the
download progress of the XML. Once the XML file has completely loaded, the
onEnterFrame
event handler gets deleted so it doesn’t continue to calculate the download
progress. Depending on how fast the download completes, you should be able to see the
bar slowly grow until the
bar_mc
is the same width as the
stroke_mc
movie clip. If the
download occurs too fast, the progress bar may go from 0% to 100% too quickly, making
the effect harder to see; in this case it may be necessary to try downloading a larger
XML file.
Using HTTP to connect to server-side
scripts
The loadVariables function, loadVariablesNum function, getURL function,
loadMovie function, loadMovieNum function functions and the loadVariables
(MovieClip.loadVariables method), loadMovie (MovieClip.loadMovie method), and
getURL (MovieClip.getURL method) methods can communicate with server-side
scripts using HTTP or HTTPS protocols.These functions and methods send all the variables
from the timeline to which the function is attached. When used as methods of the MovieClip
object,
loadVariables()
,
getURL()
, and
loadMovie()
send all the variables of the specified
movie clip; each function (or method) handles its response as follows:
■
The
getURL()
function returns any information to a browser window, not to
Flash Player.
■
The
loadVariables()
method loads variables into a specified timeline or level in
Flash Player.
■
The
loadMovie()
method loads a SWF file into a specified level or movie clip in
Flash Player.
When you use
loadVariables()
,
getURL()
, or
loadMovie()
, you can specify
several parameters:
■
URL
is the file in which the remote variables reside.
■
Location
is the level or target in the SWF file that receives the variables. (The
getURL()
function does not take this parameter.)
For more information about levels and targets, see
Chapter 1, “About Multiple Timelines
and levels”
in
Using Flash
.
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...