# 3D MovieClip position in 2D (on stage)

**URL:** <https://forum.kirupa.com/t/3d-movieclip-position-in-2d-on-stage/317889>\
**Category:** flash\
**Created:** [January 5, 2011, 11:08am UTC](https://forum.kirupa.com/t/3d-movieclip-position-in-2d-on-stage/317889 "2011-01-05T11:08:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![neohades](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@neohades](https://forum.kirupa.com/u/neohades)\
**Post date:** [January 5, 2011, 11:08am UTC](https://forum.kirupa.com/t/3d-movieclip-position-in-2d-on-stage/317889/1 "2011-01-05T11:08:59Z")

</div>

hi!

i simply can’t solve a problem, and can’t find anything good about it on google either…

i have a MovieClip, and it moves on stage with random x,y,z, and i want to attach another MC to it (kind of alt-cloud), but i don’t want to put it in 3D space, because it gets all blurry (ther’s a text in that MC), so i want to track 2D stage position of the MC that’s in 3D space… what i need is something like an offset calculated, dependant on the z position… what i come up with is calculating the scaleRatio and using it to do the offset, but it doesn’t do the trick (the offset is to large), the code below:

```auto

function calc2DCoords(pointIn3D:Object):Point{
    var focalLength:int = 300;
    var pointIn2D = new Point();
    var scaleRatio = focalLength/(focalLength + pointIn3D.z);
    pointIn2D.x = pointIn3D.x * scaleRatio;
    pointIn2D.y = pointIn3D.y * scaleRatio;
    return pointIn2D;
};

```

please help 🙂
