#12001/7/7 8:05:06
这是一个随机上下左右移动的互动行为程序,可是一附给精灵,运行后,精灵变不见了,请问这程序错在那?
property movieWidth,movieHeight
property moveH,moveV
property soundmember
property currSprite
on beginSprite me
movieWidth = the stageRight - the stageLeft
movieHeight = the stageBottom - the stageTop
currSprite = sprite(me.spriteNum)
end
on exitframe me
currSprite.locH = currSprite.locH+random(-moveH,moveH)
currSprite.locV = currSprite.locV+random(-moveV,moveV)
if currSprite.locH > movieWidth then
currSprite.locH = currSprite.locH-movieWidth
end if
if currSprite.locH < 0 then currSprite.locH = currSprite.locH * -1
if currSprite.locV > movieHeight then
currSprite.locV = currSprite.locV-movieHeight
end if
if currSprite.locV < 0 then currSprite.locV = currSprite.locV * -1
end
on mousedown me
currSprite.ink = 2
if not voidP(soundMember) <> VOID then
puppetSound 1,soundMember
end if
end
on mouseup me
currSprite.ink = 36
end