Thanks Irv

Like I said it was untested lingo. The only thing that we both neglected was
to set the p_Int_InitX and p_Int_InitY values from something other than void
(their default values).  The p_Int_InitX and corresponding Y sets the intial
loc point for the thumb, it will also by default then set the permanent X
position. The Y value should be set within the bounds of the max and min
values that you set.  And if you want to make it more useable, consider
adding a on GetPropertyDescriptionList call to set the properties in the
GPDL dialogue when you drop the behaviour on the sprite vs. setting all the
properties in the beginSprite handler.  I didn't do that because I was being
lazy and my wife was screaming at me to get my butt upstairs for lunch or
face the consequences!.. didn't wait around to find out what the
consequences where, but she had a castiron frying pan in her hands :).
Enough joking I got to get back to work.

Sincerely

Mark

--------------------------------------------
Mark R. Jonkman
Mark R. Jonkman Consulting
ADDRESS: 20 Windermere Crt., Guelph, ON, CANADA N1E 3L4
PHONE: 519-837-8509
EMAIL: [EMAIL PROTECTED]
--------------------------------------------

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Irv Kalb
> Sent: September 7, 2000 3:39 PM
> To: [EMAIL PROTECTED]
> Subject: RE: <lingo-l> dragging sprite
>
>
> At 12:55 PM -0400 9/7/00, Mark R. Jonkman wrote:
> >Hi Colby
> >
> >This is untested lingo to get you going
> >
> >property p_Int_MaxHeight
> >property p_Int_MinHeight
> >property p_Sprite
> >property p_Int_InitX
> >property p_Int_InitY
> >property p_Bool_DragFlag
> >
> >on beginSprite me
> >     p_Int_MaxHeight = 100
> >     p_Int_MinHeight = 0
> >     p_Sprite = sprite(me.spriteNum)
> >     p_Sprite.loc = point(p_Int_InitX, p_Int_InitY)
> >end beginSprite
> >
> >on mouseDown me
> >     p_Bool_DragFlag = TRUE
> >     mDrag(me)
> >end mouseDown
> >
> >on mouseUp me
> >     p_Bool_DragFlag = FALSE
> >end mouseUp
> >
> >on prepareFrame me
> >     if p_Bool_DragFlag then
> >             mDrag(me)
> >     end if
> >end prepareFrame
> >
> >on mDrag me
> >     v_Int_CurrentLocV = (the mouseLoc).locV
> >     if (v_IntCurrentLocV >=  p_Int_MinHeight) or (vIntCurrentLocV <=
> >p_Int_MaxHeight) then
> >             pSprite.locV = v_IntCurrentLocV
> >     else
> >             if (vIntCurrentLocV < p_Int_MinHeight) then
> >                     pSprite.locV = p_Int_MinHeight
> >             else
> >                     pSprite.locV = p_Int_MaxHeight
> >             end if
> >     end if
> >end mDrag
> >
>
> Mark's approach here was right on.  I just cleaned it up a bit, added
> an important on mouseUpOutside handler, and changed an "or" to an
> "and" in his mDrag handler:
>
> property p_Int_MaxHeight
> property p_Int_MinHeight
> property p_Sprite
> property p_Int_InitX
> property p_Int_InitY
> property p_Bool_DragFlag
>
> on beginSprite me
>    p_Int_MaxHeight = 100
>    p_Int_MinHeight = 0
>    p_Sprite = sprite(me.spriteNum)
> end beginSprite
>
> on mouseDown me
>    p_Bool_DragFlag = TRUE
>    mDrag(me)
> end mouseDown
>
> on mouseUp me
>    p_Bool_DragFlag = FALSE
> end mouseUp
>
> on mouseUpOutside me
>    p_Bool_DragFlag = FALSE
> end mouseUpOutside
>
> on prepareFrame me
>    if p_Bool_DragFlag then
>      mDrag(me)
>    end if
> end prepareFrame
>
> on mDrag me
>    v_Int_CurrentLocV = (the mouseLoc).locV
>    if (v_Int_CurrentLocV >=  p_Int_MinHeight) and (v_Int_CurrentLocV
> <=p_Int_MaxHeight) then
>      p_Sprite.locV = v_Int_CurrentLocV
>    else
>      if (v_Int_CurrentLocV < p_Int_MinHeight) then
>        p_Sprite.locV = p_Int_MinHeight
>      else
>        p_Sprite.locV = p_Int_MaxHeight
>      end if
>    end if
> end mDrag
> --
> Lingo / Director / Shockwave development for all occasions
>             (We even do weddings and Bar Mitzvahs!)
>    See our kid's CD-Rom's at:  http://www.furrypants.com
>
> [To remove yourself from this list, or to change to digest mode, go to
> http://www.penworks.com/LUJ/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/LUJ/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