592
Chapter 7: ActionScript for Flash
Parameters
point
The name or identifier of an object created with the
Object class
, specifying the
x
and
y
coordinates as properties.
Returns
Nothing.
Description
Method; converts the
point
object from the movie clip’s (local) coordinates to the Stage
(global) coordinates.
You can extend the methods and event handlers of the MovieClip class by creating a subclass.
Example
The following example converts
x
and
y
coordinates of the
my_mc
object, from the movie clip’s
(local) coordinates to the Stage (global) coordinates. The center point of the movie clip is
reflected after you click and drag the instance.
this.createTextField("point_txt", this.getNextHighestDepth(), 0, 0, 100, 22);
var mouseListener:Object = new Object();
mouseListener.onMouseMove = function() {
var point:Object = {x:my_mc._width/2, y:my_mc._height/2};
my_mc.localToGlobal(point);
point_txt.text = "x:"+point.x+", y:"+point.y;
};
Mouse.addListener(mouseListener);
my_mc.onPress = function() {
this.startDrag();
};
my_mc.onRelease = function() {
this.stopDrag();
};
}
See also
MovieClip.globalToLocal()
MovieClip._lockroot
Availability
Flash Player 7.
Usage
my_mc
._lockroot
:Boolean
Description
Property; specifies what
_root
refers to when a SWF file is loaded into a movie clip. The
_lockroot
property is
undefined
by default. You can set this property within the SWF file that
is being loaded or in the handler that is loading the movie clip.
Содержание FLEX
Страница 1: ...Flex ActionScript Language Reference ...
Страница 8: ......
Страница 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0 ...
Страница 76: ......
Страница 133: ...break 133 See also for for in do while while switch case continue throw try catch finally ...
Страница 135: ...case 135 See also break default strict equality switch ...
Страница 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while ...
Страница 229: ...while 229 i 3 The following result is written to the log file 0 3 6 9 12 15 18 See also do while continue for for in ...
Страница 808: ...808 Chapter 7 ActionScript for Flash ...
Страница 810: ...810 Appendix A Deprecated Flash 4 operators ...
Страница 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code ...
Страница 816: ...816 Appendix B Keyboard Keys and Key Code Values ...
Страница 822: ...822 Index ...