Classes Used
DOMExMouseFollow.as   ThreeDObjectMaker.as   Checker.as   DOMEx.as   LoadSomeXML.as  

XML Used
defaultCube.xml 

Example:
(requiers Flash Player 10+)
Example of a 3D Cube moving with the mouse no matter where the mouse is.

DOMEx Based Wrapper Mouse Follow

view: DOMExMouseFollow   ThreeDObjectMaker  Checker  DOMEx  LoadSomeXML

As is, the DOMExMouseFollow class is ready for a Flex compiler.
In that case, the ThreeDObjectMaker will embed an xml file of default specs.

Using [Embed...] is not, by default, possible in the Flash IDE.

These are the steps for compiling this example in the IDE:

1. Comment out this line in ThreeDObjectMaker:
[Embed(source="defaultCube.xml", mimeType="application-octet/stream")]
(Do not comment out private var dCube:Class;)

2. Then, when calling theCube.loadDirectObjectSpecs in DOMExMouseFollow, pass xml as the first and only param:
theCube.loadDirectObjectSpecs(myXML);

Copy the xml from defaultCube.xml as the myXML variable - using {} notation to enter sW and sH where needed.
(Write this variable inside of DOMExMouseFollow, don't put any code in the IDE (Actions Pannel))

3. DOMExMouseFollow.as needs to be in a location that has both your org (with pv3d) and com (with tadSrc) folders.
ThreeDObjectMaker.as needs to be in the same place.
Save a blank .fla named DOMExMouseFollow in the same place.

4. Open that fla and put DOMExMouseFollow as the Document Class.
The publish settings should be for Flash 10.
For the example, the stage width and height are 300 and the framerate should be 30.

(Neat Note: The example on actiontad was compiled with a Flex compiler - one made with the Flash IDE will have smoother animation)

5. Test or publish the swf. A semi-large cube should appear and follow the mouse.


www.actiontad.com