This page is no longer updated - please visit http://ghostwire.com Thank you!
 

« PHPObject »
An Opensource Alternative to Flash Remoting
Current Release
Readme
Notes
Journal
Archives

Readme
Friday May 02, 2003

Setting movieclips as PHPObjects

This feature is new in PHPObject v1.4. You can set a movieclip as a PHPObject, allowing its properties to be sent to the server during every connection, getting them manipulated (or stored in a database, for example), and then having these properties assume new values automatically when the server returns the results. For example, if the server sets the '_visible' property of the movieclip to zero, the movieclip will actually becomes invisible when the server results are received.

To use this feature, you need to include an additional actionscript file "PHPMovieClip.as". Any movieclip on the stage can be set as a PHPObject. For example, if you have a movieclip symbol named "block_mc" on the stage:

// import the PHPObject library
#include "PHPObject.as"
// import the PHPMovieClip library
#include "PHPMovieClip.as"
// link the movieclip with a remote PHP class
block_mc.PHPMovieClip("Foo");
// invoke a remote method!
block_mc.changePosition("New York");
By default, the following properties are sent and received:
'_alpha','_height','_rotation','_visible','_width','_x','_xscale','_y','_yscale'

This list can be configured (in the files PHPMovieClip.as and Gateway.php).

Be careful about setting a movieclip with several nested movieclips as a PHPMovieClip - properties of all the nested movieclips are also sent to the server (resulting in a larger message size).

I haven't considered thoroughly whether this feature is useful. I have done this more for the sake of completeness. Therefore, you may face certain glitches (I am aware that if you shift the positions of nested movieclips, the whole movieclip may get scaled unexpectedly).

You may also look into the PHPMovieClip.as as an example of how to extend PHPObject.

Posted by sunny at May 2, 2003 11:50 AM

 

Comments

Can a movieclip reference or path be set as a property of a PHPObject? I have an existing mc on stage and I want the PHPObject to use it to display some things. I would like to be able to do something like this:

myFoo.myMovieClip = this.myClip;

.... and then later on, after filling in some data
myFoo.myMovieClip._width = myFoo.myWidth;

Is this possible?

Posted by: Jim at June 24, 2003 02:37 AM

existing_mc.PHPMovieClip("Foo");

Posted by: sunny at July 1, 2003 05:14 PM

 


Zones



Forums