Url (Movieclip._Url Property) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

_url (MovieClip._url property)

public _url : String [read-only]
Retrieves the URL of the SWF, JPEG, GIF, or PNG file from which the movie clip was
downloaded.
Availability: ActionScript 1.0; Flash Player 4 - The ability to retrieve the URL of JPEG files
from which the movie clip was downloaded is available as of Flash Player 6. The ability to
retrieve the URL of GIF files and PNG files from which the movie clip was downloaded is
available as of Flash Player 8.
Example
The following example displays the URL of the image that is loaded into the
instance in the Output panel.
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
The
object contains a custom menu item labeled
menu_cm
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;
};
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);
image_mcl.loadClip("photo1.jpg", image_mc);
function viewImage(target_mc:MovieClip, obj:Object) {
getURL(target_mc._url, "_blank");
}
When you right-click (Windows) or Control-click (Macintosh) the image at runtime, select
View Image in Browser from the context menu to open the image in a browser window.
936
ActionScript classes
ContextMenu object to the
menu_cm
.
viewImage()
image_mc
image_mc
View Image in Browser
movie clip.
that has

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF