Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Noise Algorithm 2
Menu bar emulator
Generic behavior to get Key State.
Rollover Fader-Alphamania
Dialogs - Tell Me Something
Color Dialog behavior
open control pannel
Lingo in a Nutshell
A cool button
Real Time Vector Editor
 

 

 

Behavior Scroll Text With Mouse

Added on 5/30/2000

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: PauloBarreiros

Scrolls a text or field member with the mouse rather than scroll bars

property nome,velocidade,linhas
global posrato,posrato1,posicao,orienta,n,temp

on mouseenter me  
  velocidade=5  
  linhas=(member(nome).height)-(member(nome).pageheight)
end



on mousewithin
  posrato1=the mousev
  if posrato1 > posrato then
    orienta=true
    if n=0 then
      n=1
      temp=the mousev
    end if  
  end if
  if posrato1 < posrato then
    orienta=false
    if n=1 then
      n=0
      temp=the mousev
    end if      
  end if
  if posrato1=posrato then
    temp=the mousev+velocidade
  end if
  if orienta=true then
    --    cursor member("Baixo")
    if posicao >=linhas then  
      posicao=posicao
    else      
      movement=abs((the mousev-temp) /Velocidade)
      posicao=posicao+movement
    end if    
  else
    --    cursor member("Cima")
    if posicao <=0 then
      posicao=posicao      
    else
      movement=abs((temp-the mousev) /Velocidade)
      posicao=posicao-movement
    end if  
  end if
  member(nome).scrollTop=posicao
  posrato=the mousev  
end

on mouseLeave me
  cursor 0
  posrato=0
end


on getPropertyDescriptionList me
  theProps = [:]
  
  eligibleMembers = []
  repeat with i = 1 to the lastChannel
    case sprite(i).member.type of
      #field, #text:
        if sprite(i).member.boxtype = #fixed then
          put "yes" & i
        put sprite(i).member.boxtype  
          add eligibleMembers, sprite(i).member
        end if
      otherwise: next repeat
    end case
  end repeat
  put eligibleMembers
  c = "What is the text box to Scroll?"
  addProp theProps, #Nome, [#comment:c, #format:#string, #range: eligibleMembers, #default: 1]
  
  return theProps
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail