FORUMS: list search recent posts

mapping values to control scale

COW Forums : Adobe Flash

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

Hi

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;
updateAfterEvent();
}
this.beam_mc.onEnterFrame = function(){
this._x = _root._xmouse;
this._yscale = stretch;
stretch = laser_mc._y * -.41+215;
trace("STR="+stretch);
trace("MCY="+laser_mc._y);
updateAfterEvent();
}

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.

http://dev.binaryinteractive.com/public/scanner.swf
http://dev.binaryinteractive.com/public/scanner.fla

many thanks
mm66



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]