-
1. Re: Make simultaneously or sequentially moveable and editable fields or text sprites in movie.
Rod@FOF May 30, 2014 7:44 AM (in response to Rod@FOF)Just a quick p.s. I have been able to achieve the desired action by using an if-then loop on the mousedown. But this is extremely confusing for the users who never know from one moment to the next if they are moving or inputting.
______________________________________________________________________________
property spritenum
on mouseenter me
sprite(spritenum).moveablesprite = true
sprite(spritenum).editable = false
endon mouseleave me
sprite(spritenum).editable = false
sprite(spritenum).moveablesprite = false
endon mousedown me
if sprite(spritenum).moveablesprite = true then
sprite(spritenum).moveablesprite = false
sprite(spritenum).editable = true
else
sprite(spritenum).moveablesprite = true
sprite(spritenum).editable = false
end if
end -
2. Re: Make simultaneously or sequentially moveable and editable fields or text sprites in movie.
Ladnarth May 31, 2014 6:28 AM (in response to Rod@FOF)Just set your text properties in the property inspector and attach a drag sprite behavior.
-- Drag sprite
property sp -- this sprite
property pStartLoc -- sprite location upon mouseDown
property pMouseStart -- mouse location upon mouseDown
property pMoving -- flag for enterFrame. True/False
on beginSprite me
sp = sprite(me.spriteNum)
pMoving = false
end beginSprite
on mouseDown me
pStartLoc = sp.loc
pMouseStart = _mouse.mouseLoc
pMoving = true
end mouseDown
on mouseUp me
pMoving = false
end
on mouseUpoutside me
pMoving = false
end
on enterFrame me
if not pMoving then exit
deltaMouse = _mouse.mouseLoc - pMouseStart
sp.loc = pStartLoc + deltaMouse
end enterFrame
-
3. Re: Make simultaneously or sequentially moveable and editable fields or text sprites in movie.
Rod@FOF May 31, 2014 9:49 AM (in response to Ladnarth)Thank you for the solution. I like how you worked around the dilemma I faced by allowing the editability of the sprite to be controlled by the property manager leaving only the draggable issue for the mousedown handler. It works 99% well. Only problem is that while dragging some of the text becomes highlighted some of the time and it looks a bit cludgy. But certainly much better than where I started! Thanks again.
Rod

