Scrolling teks dengan menggunakan gerakan mouse.
Seperti biasa anda buat teks box dengan property framingnya = fixed
Selanjutnya anda buat script behaviour dibawah ini :
------------------------------------------------------------------------
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 <>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
if posicao >=linhas then
posicao=posicao
else
movement=abs((the mousev-temp) /Velocidade)
posicao=posicao+movement
end if
else
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 = "Teks box mana yang akan discroll?"
addProp theProps, #Nome, [#comment:c, #format:#string, #range: eligibleMembers, #default: 1]
return theProps
end
------------------------------------------------------------------------
(sumber: www.Augesweb.com)
Jumat, 14 Maret 2008
Scrolling Text - 1
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar