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
You will have to most likely do some modifications in order to make it work
correctly, but hopefully this will give you an idea as to where to start.
You will want to set it up so that you determine an offset value for the
clickLoc so that you adjust your vertical position accordingly. But
hopefully this will get you started. I haven't tested it so beware that
there might be some serious errors.
Hope it helps
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 Colby Dodson
> Sent: September 7, 2000 12:31 PM
> To: [EMAIL PROTECTED]
> Subject: <lingo-l> dragging sprite
>
>
> I am want to drag a sprite the the mouse I have to simple drag script
> working but I want to be able to drag it vertically only and be
> able to set
> boundaries of how far I can drag it on the stage.
> Can anyone help?
>
> Thanks
> Colby
>
> [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!]