Hi Jon,
imagine you have a lot of nested clips, structure a-b-c-d-e for example (a
is parent of b, b is parent of c etc).
Imagine a is scaled 50% and the rest hundred. Then you can be sure, b/c/d/e
will be 50% as well.
If b is scaled 50% as well, c/d/e will be at 25% (a's 50 times b's 50).
Damn we could do this all night long... anywayz to make a long story even
longer, if you wanted c/d/e etc still to show up at a hundred percent, you
need to turn 25% into a 100%, in other words, you need to scale them up 4
times (400%).
This is ofcourse 100/25.

So in general to keep a child scaled at 100% independents of its parents,
you need to divide 100% by the result of multiplying all its parent's scale
factors.

Eg, to keep e at 100%, you'd scale e to : 1/ (
a.scale*b.scale*c.scale*d.scale/100^4)

Sorry for the fuzzy explanation.. its been a long day :)

greetz
JC




On 11/1/06, Jon Bennett <[EMAIL PROTECTED]> wrote:

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
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to