# Help with zoom in/out from 3D in flash tutorial

**URL:** <https://forum.kirupa.com/t/help-with-zoom-in-out-from-3d-in-flash-tutorial/32113>\
**Category:** flash\
**Created:** [October 1, 2003, 6:11pm UTC](https://forum.kirupa.com/t/help-with-zoom-in-out-from-3d-in-flash-tutorial/32113 "2003-10-01T18:11:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![subhashls](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@subhashls](https://forum.kirupa.com/u/subhashls)\
**Post date:** [October 1, 2003, 6:11pm UTC](https://forum.kirupa.com/t/help-with-zoom-in-out-from-3d-in-flash-tutorial/32113/1 "2003-10-01T18:11:52Z")

</div>

Hi,

I am pretty new to Flash, and I have started going through alot of this tutorials on this site, and it is really great btw. Anyhow, I was reading through the zoom in/out tutorial in the ActionScript \> 3D in Flash tutorial, and I am having a little trouble figuring out where I should put the code, and actually see it work.

I did the following. I only made one figure so far, because I was just doing a test:

1. I draw a simple shape on the stage, converted it into a movie clip, and named it figureA

2. I then double clicked on it, and in the first frame, right clicked \> Actions, and wrote the following code:

origin = new Object();  
origin.x = 150;  
origin.y = 150;

focalLength = 300;

figureA.x = -50;  
figureA.y = 0;  
figureA.z = 0;  
figureA.dir = 1;

backAndForth = function(){  
this.z += speed\*this.dir;  
if (this.z \> 500){  
this.z = 500;  
this.dir = -1;  
}else if (this.z \< 0){  
this.z = 0;  
this.dir = 1;  
}

```
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;
this.swapDepths(-this.z);

```

};

figureA.onEnterFrame = backAndForth;

My question is what am I suppose to do next? Insert a keyframe and make a motion tween? I am kinda lost in the difference between actionscript motion or using motion tween. Any help would be greatly appreciated. Thanks
