I just am looking over the CS4/3D methods and am a little bit stumped at this:
globalToLocal3D…
I am just trying to determine parameters to dynamically resize the width of myMc (once it is pushed back in z dimension - say to 2000) - I am basically using the globalToLocal3D method - yet the compiler is throwing errors -
Error #2004: One of the parameters is invalid.
here is the code that should be self explanatory
(other than the fact that I am doing something wrong)…
myMc.addEventListener(Event.ENTER_FRAME,showData)
function showData(evt:Event):void{
var myStagePoint:Point = new Point(0,140);
var myVector:Vector3D = new Vector3D();
var myClip = evt.target;
myVector = myClip.globalToLocal3D(myStagePoint);
data_x.text = String(myVector.x);
data_y.text = String(myVector.y);
data_z.text = String(myVector.z);
}
UPDATE - SOLVED
needed to instantiate the Matrix3D on myMc by explicitly giving it a value for z
myMc.z = 0;
boy - this is exceptionally strict