EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - Using HTTP to Connect to Server-Side Scripts

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...
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 doesnt 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.

Table of Contents

Related product manuals