James I hope this doesn't sound too stupid... but I cant get the script
u sne tworking...
How do I call it once and pass it a member number...

Please can u show me an example call

Thanx
Jayp



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of James Newton
Sent: 27 February 2002 22:20
To: [EMAIL PROTECTED]
Subject: Re: <lingo-l> Resizing Lingo problem!

Jayp <[EMAIL PROTECTED]> wrote:

> if its still larger than a certain size it doest repeat the
> process....do I need some dsort of repeat loop...

Hi Jayp,

Don't use a repeat loop, use a ratio.  Presumably you also want to limit
the
height.  The following handler does not work off exitFrame, so you can
call
it only once, and pass a member number as a parameter.


on mSetMember(me, aMember)
  tSprite = sprite(me.spritenum)
  aMember = member(aMember)
  tSprite.member = aMember
  
  maxWidth  = 350
  maxHeight = 174
  
  tWidth  = aMember.width
  tHeight = aMember.height
  
  -- Constrain width
  if tWidth > maxWidth then
    tHeight = (tHeight * maxWidth) / tWidth
    tWidth  = maxWidth -- in other words: (tWidth * maxWidth) / tWidth
  end if
  
  -- Constrain height
  if tHeight > maxHeight then
    tWidth  = (tWidth * maxHeight) / tHeight
    tHeight = maxHeight
  end if
  
  tSprite.width  = tWidth
  tSprite.height = tHeight
end


Cheers,

James

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]).
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to