|
|
 |
|
Ladybug-
download
this sample files
This
sample show how to use the command "fas.event.spriteBound"
to precisely identify the repaint area to iceProjector program for
improving the fullscreen movie's performance.

- In the frame 1, the movie clips "ladybugMC" animates
the bug sprite and move itself to follow the mouse cursor. As
iceProjector sends all mouse events from the desktop to flash
movie (even when the cursor is outside the flash movie area),
the bug will always follow the cursor everywhere on the desktop.
- And in the same frame (frame 1), we add the actionscripts as
following. Please read the description for each command line below:
var mySpriteBound;
//Declare the variable for storing the repainting rectangle later.
fscommand("fas.win.ClickToMove", "FALSE");
fscommand("fullscreen", "TRUE");
//Disable clicking-to-move flash window and set the movie to full
screen mode.
fscommand("fas.event.spritebound","_root.GetBoundFrame,_root.mySpriteBound");
//Declare the frame labeled with "GetBoundFrame" to
handle the spritebound event and set the "mySpriteBound"
variable to store the repaint rectangle.
In other words: The above fscommand tell iceProjector that whenever
it need to repaint the movie:
1. Go to the frame labeled with"GetBoundFrame" to execute
the actionscripts in the frame.
2. Get the repaint rectangle information from the object variable
"mySpriteBound"
stop();
//Stop main timeline.
- In the frame 2, we label it as "GetBoundFrame". And
add the command line below:
mySpriteBound = ladybugMC.GetBounds(_root);
// The command line above use the method "GetBounds"
to get the rectangle area (the minimal and maximum x,y coordinate
values) from the movie clip "ladybugMC". And store the
information to the object variable "mySpriteBound":
-
In this way, the iceProjector only repaints the area covering
ladyBug animation instead of the whole 800*600 fullscreen area.
|
|