next up previous contents
Next: Events Up: Methods Previous: getMovieInfo   Contents


movieToWindow

Description

Converts a rectangle from the movie coordinates system to the windows client coordinates system


Syntax

FlashPlayer.movieToWindow(left, right, top, bottom)


Parameters

left
A number specifies the x-coordinate of the upper-left corner of the rectangle
right
A number specifies the x-coordinate of the lower-right corner of the rectangle.
top
A number specifies the y-coordinate of the upper-left corner of the rectangle
bottom
A number specifies the y-coordinate of the lower-right corner of the rectangle


Returns

An object with the properties left, top, right, and bottom


Example

The example shows how to place an ActiveX control onto a MovieClip.

//Providing the name of the MovieClip is
"mymovie".
//Get the placement of the MovieClip
//in the Action Script:
var pos = mymovie.getBounds();
//Then converts the placement to
//the windows client coordinates
//system in the FFish Script:
FlashPlayer.bindData("pos.xMin", "pos.yMin",
"pos.xMax", "pos.yMax");
FlashPlayer.updateData(true);
var rect = FlashPlayer.movieToWindow(
    FlashPlayer.pos.xMin,
    FlashPlayer.pos.xMax,
    FlashPlayer.pos.yMin,
    FlashPlayer.pos.yMax);

var mp = createControl("MediaPlayer.MediaPlayer.1");
mp.window.left = rect.left;
mp.window.top = rect.top;
mp.window.width = rect.right - rect.left;
mp.window.height = rect.bottom - rect.top;




Copyright ©2000-2010 Shanghai TopCMM Software Technologies. All Rights Reserved.