Hi Stanly,

> Now I want it on the mouseDown. Means when I I keep my mouse
> button pressed i want to scroll my text one line by line till
> I reach the end of the text.

I think I can help you with that one.

(Oddly enough, I haven't actually done a text scroll bar in Director before,
but I can help you with the bare-bones of the approach that you need)

The way to approach it, is to write a behavior:
(e-mail lingo follows)

property pPressed

on beginSprite me
  pPressed = False
end

-- sets the pressed property to true
on mouseDown me
  pPressed = True
end

--sets the pressed property to false
on mouseUp me
  pPressed = False
end

on prepareFrame me
  if pPressed then
  --here's where you insert the scrolling code that worked for you before on
the mouseUp
  --(if you want more help with that, tell me)
  end if
end

The prepareFrame handler executes each time the playback head moves (like
the exitFrame), and since it's attached to a sprite, it will only affect the
sprite, and not the entire movie, which makes it a great place for executing
all kinds of animation - such as the scrolling.

You can also customize the behaviour by adding a gpdl, which will pop up
when you attach the sprite to the cast member. There you can choose the
target text or field cast member, and wether the scrolling will be up or
down. here's a possible script for that (you insert it into the same script
as the above:)

on getPropertyDescriptionList me
  gpdl = [:]
  gpdl[#pDir] = [#default: "", #format: #string, #comment: "Up or Down?",
#range: ["up",     "down"]]
  gpld[#pTextMemeber] = [#default: "", #format: #string, #comment: "Target
Text Member"]
end

Then on beginSprite me you add
case pDir of:
  "up": --- do what you need to make it scroll up (such as setting a
variable to a negative  value)
  "down:  --- do what you need to make it scroll down (such as setting a
variable to a positive value)
end case

and don't forget to add at the top of your script:
property pPressed, pDir, pTextMember
(along with any other properties you need)


Hope this helps you start,

Karina



[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