FORUMS: list search recent posts

mapping values to control scale

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
mapping values to control scale
on Sep 5, 2007 at 11:47:17 pm


I need to map one set of values to another to control the scaling of an MC.
I need the _y value of 482 to equal 15% _yscale, and the _y value to equal 100% _yscale.

The code I fudged so far goes:
this.scanner_mc.onEnterFrame = function(){
this._x = _root._xmouse;
this.beam_mc.onEnterFrame = function(){
this._x = _root._xmouse;
this._yscale = stretch;
stretch = laser_mc._y * -.41+215;

this.laser_mc.startDrag(true, 80, 240, 660, 500);

I basically guessed at the values for 'stretch' but I know there has to be a smart trigonometry way of calculating it.

It is easier if I show you, so I posted an SWF/FLA so you can see what I am trying to acheive and the code I have used so far to get there.

many thanks

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved