Hi Anil,

> The solution is in your  mouse down handler..use "repeat while the
> stillDown" as shown below:
>
> on mouseDown
>   repeat while the stillDown
>     scrollByLine member "txt2", +1
>     end repeat
> end
>
> This should solve your problem..
>
> In the above case "on mouse down" the line will scroll down 1
> line by line
> till it reaches the end..

It's better to avoid tight loops like you have there, since they tend to
stop everything else happening. It would be better to use a behaviour and
set up a boolean property on mouseDown to True and reset it to False on
mouseUp.
Your code, thus modified, would look like this:

property pbPressed

on mouseDown me
 pbPressed = True
end

on mouseUp me
 pbPressed = False
end

on prepareFrame me
  if pbPressed then
     --and then insert your scrolling code here:
     scrollByLine member "txt2", +1
  end if
end


I find that this type of approach works with most types of animation,
including drag&drop. for example, the same behaviour with a different
"prepareFrame" would look like:

on prepareFrame me
  if pbPressed then
     sprite(me.spriteNum).loc = the mouseLoc
  end if
end



Regards,
Karina Steffens,
Multimedia Designer/Programmer

Martello Media Ltd.
4 Islington Avenue
Sandycove
Co. Dublin

Tel: +353 1 2844668
Fax: +353 1 2803195
http://www.martellomm.ie










[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