|
-
Making a Zoom function. Need math help
Hello all,
I have created a function that zooms (x1.2 or 20%) in and centers the location clicked of a certain movie clip. The second part of this function was to reposition another much smaller movieclip that is on top of that movie clip so that it scales and moves like the whole thing was scaling and moving together. I got most of it figured out and if I take off the zoom tweens I can get this smaller movieclip to go where it is supposed to. The problem is that when the background main movieclip expands 20%, my desired x and y position of the above smaller movieclip moves towards the bottom right corner ever so slightly because it is growing. So basically I need to create an equation that compensates for how much the width and height move throw off the answer that I have so far.
If the width and height of the background movie clip are growing by 20% then each little part will get bigger 20% bigger but I can't figure this out now because my brain is mush.
right now I have it like so:
*f1Valye3x and y are a different variables that correctly find the location of where the correct answer would be if not for the slight growth of the background MovieClip throwing off my values. I am hoping that I can add something that will compensate for that slight growth no matter where it is.
f1.x = f1Value3X + _________ ;
f1.y = f1Value3Y + ________ ;
I am probably doing this backwards by doing it without the zoom first, I dunno.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|