MovieClip.globalToLocal()
583
Example
The following ActionScript creates a new movie clip instance and opens the Macromedia website
in a new browser window:
this.createEmptyMovieClip("loader_mc", this.getNextHighestDepth());
loader_mc.getURL("http://www.macromedia.com", “_blank”);
The
getURL()
method also allows you to send variables to a remove server-side script, as seen in
the following code:
this.createEmptyMovieClip("loader_mc", this.getNextHighestDepth());
loader_mc.username = "some user input";
loader_mc.password = "random string";
loader_mc.getURL("http://www.flash-mx.com/mm/viewscope.cfm", "_blank", "GET");
See also
getURL()
,
LoadVars.sendAndLoad()
,
LoadVars.send()
MovieClip.globalToLocal()
Availability
Flash Player 5.
Usage
my_mc
.globalToLocal(
point:Object
)
: Void
Parameters
point
The name or identifier of an object created with the generic
Object class
. The object
specifies the
x
and
y
coordinates as properties.
Returns
Nothing.
Description
Method; converts the
point
object from Stage (global) coordinates to the movie clip’s
(local) coordinates.
You can extend the methods and event handlers of the MovieClip class by creating a subclass.
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");
Summary of Contents for FLEX-FLEX ACTIONSCRIPT LANGUAGE
Page 1: ...Flex ActionScript Language Reference...
Page 8: ......
Page 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0...
Page 76: ......
Page 133: ...break 133 See also for for in do while while switch case continue throw try catch finally...
Page 135: ...case 135 See also break default strict equality switch...
Page 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while...
Page 808: ...808 Chapter 7 ActionScript for Flash...
Page 810: ...810 Appendix A Deprecated Flash 4 operators...
Page 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code...
Page 816: ...816 Appendix B Keyboard Keys and Key Code Values...
Page 822: ...822 Index...