Example
The following example unloads a movie clip instance called
instance.
unloadMC_btn
this.createEmptyMovieClip("image_mc", 1);
image_mc.loadMovie("http://www.macromedia.com/images/shared/product_boxes/
112x112/box_studio_112x112.jpg");
unloadMC_btn.onRelease = function() {
image_mc.unloadMovie();
};
See also
MovieClip.attachMovie(), MovieClip.loadMovie(), unloadMovie(),
unloadMovieNum()
MovieClip._url
Availability
Flash Player 4.
Usage
.
my_mc
_url:String
Description
Read-only property; retrieves the URL of the SWF or JPEG file from which the movie clip was
downloaded.
Example
The following example writes the URL of the image that is loaded into the
the log file.
this.createEmptyMovieClip("image_mc", 1);
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip) {
trace("_url: "+target_mc._url);
};
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);
image_mcl.loadClip("http://www.macromedia.com/images/shared/product_boxes/
112x112/box_studio_112x112.jpg", image_mc);
The following example assigns the ContextMenu object
The ContextMenu object contains a custom menu item labeled "View Image in Browser..." that
has an associated function named
var menu_cm:ContextMenu = new ContextMenu();
menu_cm.customItems.push(new ContextMenuItem("View Image in Browser...",
viewImage));
this.createEmptyMovieClip("image_mc", this.getNextHighestDepth());
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip) {
target_mc.menu = menu_cm;
624
Chapter 7: ActionScript for Flash
.
viewImage()
when a user clicks the
image_mc
image_mc
to the movie clip
menu_cm
instance to
.
image_mc
Need help?
Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?