- Home
- Tutorials
- Flash
- Intermediate
- PhotoShop style 'navigator' using AS 3.0 - Lesson 2 of 2

getting rid of the code we won't need
As I mentioned there is some code we will be moving into our new onEnterFrame function, that we will be creating later. So lets start by commenting out the code in question.
Go ahead and find the following code:
function zoom(event) {
if (sliderDrag==true) {
var redBoxScale = (zTool.slider.x-zTool.sliderLine.x);
if (redBoxScale>95) {
redBoxScale=95;
}
if (redBoxScale<1) {
redBoxScale=1;
}
this.zTool.targetArea.scaleX=(redBoxScale-100)/100;
this.zTool.targetArea.scaleY=(redBoxScale-100)/100;
var scaleFactor = zTool.image.width/zTool.targetArea.width;
image.width = viewArea.width* scaleFactor;
image.height = viewArea.height* scaleFactor;
}
}
zTool.slider.addEventListener(MouseEvent.MOUSE_MOVE, zoom);
If you follwed the instructions to the T in lesson 1, this should be the last function we wrote. Lets go ahead select it and delete it. If you are the nervous type who doesn't like to delet you can coment it out but surroung the code with "/*" at the begining and "*/" at the end like so:
function zoom(event) {
if (sliderDrag==true) {
var redBoxScale = (zTool.slider.x-zTool.sliderLine.x);
if (redBoxScale>95) {
redBoxScale=95;
}
if (redBoxScale<1) {
redBoxScale=1;
}
this.zTool.targetArea.scaleX=(redBoxScale-100)/100;
this.zTool.targetArea.scaleY=(redBoxScale-100)/100;
var scaleFactor = zTool.image.width/zTool.targetArea.width;
image.width = viewArea.width* scaleFactor;
image.height = viewArea.height* scaleFactor;
}
}
zTool.slider.addEventListener(MouseEvent.MOUSE_MOVE, zoom);*/

