MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference page 476

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

You can extend the methods and event handlers of the MovieClip class by creating a subclass.
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
- The name or identifier of an object created with the generic Object class. The
pt:Object
object specifies the x and y coordinates as properties.
Example
Add the following ActionScript to a FLA or AS file in the same directory as an image called
photo1.jpg:
this.createTextField("coords_txt", this.getNextHighestDepth(), 10, 10, 100,
22);
coords_txt.html = true;
coords_txt.multiline = true;
coords_txt.autoSize = true;
this.createEmptyMovieClip("target_mc", this.getNextHighestDepth());
target_mc._x = 100;
target_mc._y = 100;
target_mc.loadMovie("photo1.jpg");
var mouseListener:Object = new Object();
mouseListener.onMouseMove = function() {
var point:Object = {x:_xmouse, y:_ymouse};
target_mc.globalToLocal(point);
var rowHeaders = "<b> &nbsp; \t</b><b>_x\t</b><b>_y</b>";
var row_1 = "_root\t"+_xmouse+"\t"+_ymouse;
var row_2 = "target_mc\t"+point.x+"\t"+point.y;
coords_txt.htmlText = "<textformat tabstops='[100, 150]'>";
coords_txt.htmlText += rowHeaders;
coords_txt.htmlText += row_1;
coords_txt.htmlText += row_2;
coords_txt.htmlText += "</textformat>";
};
Mouse.addListener(mouseListener);
See also
getBounds (MovieClip.getBounds method)
(MovieClip.localToGlobal method)
476
ActionScript classes
,
localToGlobal
,
Object

Advertisement

Table of Contents
loading

Table of Contents