# globalToLocal3D - should be simple?

**URL:** <https://forum.kirupa.com/t/globaltolocal3d-should-be-simple/277062>\
**Category:** flash\
**Created:** [December 7, 2008, 3:43am UTC](https://forum.kirupa.com/t/globaltolocal3d-should-be-simple/277062 "2008-12-07T03:43:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsw\_nz](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jsw\_nz](https://forum.kirupa.com/u/jsw_nz)\
**Post date:** [December 7, 2008, 3:43am UTC](https://forum.kirupa.com/t/globaltolocal3d-should-be-simple/277062/1 "2008-12-07T03:43:40Z")

</div>

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_
