# 3D Movieclip Z axe movement troubles - Need your help

**URL:** <https://forum.kirupa.com/t/3d-movieclip-z-axe-movement-troubles-need-your-help/289534>\
**Category:** flash\
**Created:** [June 1, 2009, 3:28pm UTC](https://forum.kirupa.com/t/3d-movieclip-z-axe-movement-troubles-need-your-help/289534 "2009-06-01T15:28:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![humbucker](https://avatars.discourse-cdn.com/v4/letter/h/278dde/32.png) [@humbucker](https://forum.kirupa.com/u/humbucker)\
**Post date:** [June 1, 2009, 3:28pm UTC](https://forum.kirupa.com/t/3d-movieclip-z-axe-movement-troubles-need-your-help/289534/1 "2009-06-01T15:28:01Z")

</div>

Hi,

I’m currently working on an image gallery which is supposed to bring in front the choosen image, by changing its Z value. I also must mention the gallery is X/Y rotated with an Enterframe function working with the mouseX and mouseY position.

My problem is that when I run the script, I got something like the picture here : ![](http://www.orizonstudio.com/url/g595bq)  
The chosen picture does move on the Z axe but the image grid behing got distorted for an unknown reason.

Here is my X/Y rotation function:

```auto

regPoint.x=stage.stageWidth/2; 
regPoint.y=stage.stageHeight/2; 
regPoint.z=800; 
addChild(regPoint); 

function rotate3D(e:Event):void {
    var distx:Number = mouseX / stage.stageWidth; 
    var disty:Number = mouseY / stage.stageHeight; 
    Tweener.addTween(regPoint, {rotationY:(-50 + (100*distx)), rotationX:(50 - (100*disty)), time:1, transition:"easeOut"}); 
}

```

and here is the tween of a clicked image :

```auto

Tweener.addTween(clickedPic, {z:400, x:posX, y:posY, time:0.5, transition:"easeIn"}); 

```

Any idea ?  
I’m really willing to figure this out to keep on learning 3D with AS3.

Thanks to all of you.
