# Question about 3d perspective

**URL:** <https://forum.kirupa.com/t/question-about-3d-perspective/194934>\
**Category:** flash\
**Created:** [July 27, 2006, 9:58am UTC](https://forum.kirupa.com/t/question-about-3d-perspective/194934 "2006-07-27T09:58:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thehitman](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/thehitman/32/2621_2.png) [@thehitman](https://forum.kirupa.com/u/thehitman)\
**Post date:** [July 27, 2006, 9:58am UTC](https://forum.kirupa.com/t/question-about-3d-perspective/194934/1 "2006-07-27T09:58:56Z")

</div>

Hello people of [kirupa.com](http://kirupa.com) forums. I used the [kirupa.com](http://kirupa.com) 3d flash tutorial about zooming figures, and I created my own file. here it is: [http://www.freewebs.com/thehitman/3dtest.swf](http://www.freewebs.com/thehitman/3dtest.swf)

I have two questions about this file:

1. How can I make so that if this.z = 0,then the box movieclip stops it’s movement?
2. How can I change the z angle, so that the box would go till the end of the wall (of the room)?

Here’s the complete code:

```auto
Origin = new Object();
Origin.x = 300;
Origin.y = 250;
box.x = -50;
box.y = 0; 
box.z = 0;
FocalLength = 300;
movebackandforward = function(){
 if (Key.isDown(Key.UP) == true) {
  this.z += 20;
 }
  if (Key.isDown(Key.DOWN) == true) {
  this.z -= 20;
 }
 var scaleRatio = FocalLength/(FocalLength + this.z);
 this._x = Origin.x + this.x * scaleRatio;
 this._y = Origin.y + this.y * scaleRatio;
 this._xscale = this._yscale = 100 * scaleRatio;
};
box.onEnterFrame = movebackandforward;

```
