#42001/11/7 21:18:35
我有一种很复杂的方法,但它很实用,很长时间没用了,你可以自己研究一下。
property msp, normalMem, normalMemArray, channelRList
property status, startFlash
property channelList
property normalFrame, blankFrame, cycle, flag, enterCount, enterCycle
on beginSprite me
set channelList=[]
repeat with i=1 to count(channelRList)
set c1= getAt(channelRList,i)
if listP(c1) then
set s1= getAt(c1,1)
set e1= getAt(c1,2)
repeat with j= s1 to e1
add channelList, j
end repeat
else
add channelList,c1
end if
end repeat
set status=#waiting
set msp= the spriteNum of me
-- set normalMem= the member of sprite msp
set normalMemArray=[]
repeat with i=1 to count(channelList)
add normalMemArray, the member of sprite getAt(channelList,i)
end repeat
-- if startFlash then
beginFlash me, cycle, normalFrame, blankFrame
-- end if
end
on beginFlash me, c , nf, bf
set flag=0
set cycle=c
set normalFrame = nf
set blankFrame = bf
set status=#flashing
set enterCount=0
set enterCycle=0
end
on prepareFrame me
if status=#flashing then
set enterCount = enterCount + 1
if flag=0 then
if enterCount = normalFrame then
set enterCount=0
set flag=1
repeat with i=1 to count(channelList)
set the member of sprite getAt(channelList,i) to 0
end repeat
end if
else
if enterCount = blankFrame then
set enterCount=0
set flag=0
repeat with i=1 to count(channelList)
set the member of sprite getAt(channelList,i) to getAt(normalMemArray,i)
end repeat
set enterCycle= enterCycle+1
if cycle= enterCycle then
set status=#waiting
end if
end if
end if
end if
end
on exitFrame
if status=#waiting then
go the frame + 1
else
go the frame
end if
end
on getPropertyDescriptionList
set n=?
[?
#normalFrame,?
#blankFrame,?
#cycle,?
#channelRList?
]
set c=?
[?
"Normal frame count",?
"Blank frame count",?
"cycle",?
"Channel (Range) List"?
]
set f=?
[?
#integer,?
#integer,?
#integer,?
#integer?
]
set d=?
[?
6,?
4,?
3,?
[]?
]
set r=[:]
repeat with i=1 to count(c)
set n1= getAt(n,i)
set c1= getAt(c,i)
set f1= getAt(f,i)
set d1= getAt(d,i)
set r2=[:]
addProp r2, #comment, c1
addProp r2, #format, f1
addProp r2, #default, d1
addProp r,n1,r2
end repeat
return r
end
(?是Alt+Enter键)