Example
The following example lets you right-click (Windows) or Control-click (Macintosh) a movie
clip on the Stage and select
instance. Add several movie clips with instance names, and then add the following
ActionScript to your AS or FLA file:
var menu_cm:ContextMenu = new ContextMenu();
menu_cm.customItems.push(new ContextMenuItem("Info...", getMCInfo));
function getMCInfo(target_mc:MovieClip, obj:Object) {
trace("You clicked on the movie clip '"+target_mc._name+"'.");
trace("\t width:"+target_mc._width+", height:"+target_mc._height);
trace("");
}
for (var i in this) {
if (typeof (this[i]) == 'movieclip') {
this[i].menu = menu_cm;
}
}
See also
_name (Button._name property)
nextFrame (MovieClip.nextFrame method)
public nextFrame() : Void
Sends the playhead to the next frame and stops it.
You can extend the methods and event handlers of the MovieClip class by creating a subclass.
Availability: ActionScript 1.0; Flash Player 5
Example
The following example uses
file. Do not add any code on Frame 1, but add the following ActionScript on Frame 2 of the
Timeline:
if (this._framesloaded >= 3) {
this.nextFrame();
} else {
this.gotoAndPlay(1);
}
Then, add the following code (and the content you want to load) on Frame 3:
stop();
900
ActionScript classes
from the context menu to view information about that
Info
and
_framesloaded
to load content into a SWF
nextFrame()
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?
Questions and answers