[_] Maths: scale one mc, whilst keeping an mc within it the same size
Jon Bennett
jmbennett at gmail.com
Wed Nov 1 20:42:41 GMT 2006
hi,
I'm scaling a large-ish MovieClip to specific width/height
combinations. Within this MovieClip I have numerous link MCs, which I
want to keep at 100%, regardless of their containing MovieClip's
width/height, and the maths involved has me a little stumped!
some example code:
// attach map symbol from the stage (_width: 744 _height: 445)
var mcMap:MovieClip = this.attachMovie ('map', 'map', 20);
// attach link within mcMap (_width: 140 _height: 21)
var mcLink:MovieClip = mcMap.attachMovie ('link', 'link'+1, 200);
// example function
_root.onPress = function ()
{
mcMap._width = 2710;
mcMap._height = 1620;
mcLink._xscale = mcLink._yscale = ARRGGHH!
}
I need a formular to obtain the scale to set to the the link MC so it
stays it's original size, but I'm stumped as to what it is, anyone got
any ideas?
Thanks!
Jon
--
jon bennett
t: +44 (0) 1225 341 039 w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett
I'm scaling a large-ish MovieClip to specific width/height
combinations. Within this MovieClip I have numerous link MCs, which I
want to keep at 100%, regardless of their containing MovieClip's
width/height, and the maths involved has me a little stumped!
some example code:
// attach map symbol from the stage (_width: 744 _height: 445)
var mcMap:MovieClip = this.attachMovie ('map', 'map', 20);
// attach link within mcMap (_width: 140 _height: 21)
var mcLink:MovieClip = mcMap.attachMovie ('link', 'link'+1, 200);
// example function
_root.onPress = function ()
{
mcMap._width = 2710;
mcMap._height = 1620;
mcLink._xscale = mcLink._yscale = ARRGGHH!
}
I need a formular to obtain the scale to set to the the link MC so it
stays it's original size, but I'm stumped as to what it is, anyone got
any ideas?
Thanks!
Jon
--
jon bennett
t: +44 (0) 1225 341 039 w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett