--代码提供:mzgjingsi
--功能: 鼠标掠过一个member时,另一个sprite更换member,或者是另一个文本演员更换文本
property pRolloverMember
property pNormalMember
property pRolloverText
property pNormalText
property pTextMember
property pRolloverState
property pRolloverSprite
on getbehaviordescription me
desc = ""
put "本行为使用方法:"&RETURN after desc
put "首先选择是文本变换还是member变换"&RETURN after desc
put "如是文本变换,只需填带(text)的三项,选择member变换也是只填带(member)的三项"&RETURN after desc
put "注意“显示不同文本的member(text)”一项需选文本演员"&RETURN after desc
return desc
end getbehaviordescription
on getBehaviorTooltip me
desc = ""
put "本行为主要功能实现如下效果:"&RETURN after desc
put "1:鼠标掠过一个member时,另一个sprite更换member"&RETURN after desc
put "2:鼠标掠过一个member时,另一个member显示不同的文本"&RETURN after desc
return desc
end getBehaviorTooltip
on getPropertyDescriptionlist me
pmember=sprite(the currentSpriteNum).member
pspritenum = the currentSpritenum
list=[:]
addProp list, #pRolloverState,\
[#comment: "文本变换还是member变换?",#format:#string,\
#range:["Rollover Member","Rollover Text"],\
#default:"Rollover Text"]
addProp list, #pRolloverText,\
[#comment: "掠过时显示的文本(text)",#format:#string,#default:""]
addProp list, #pNormalText,\
[#comment: "正常状态文本(text)",#format:#string,#default:""]
addprop list,#pTextMember,\
[#comment:"显示不同文本的member(text)", #format:#text, #default

member]
addprop list,#pRolloverSprite,\
[#comment:"变换member的sprite(member)", #format:#integer, #default

spritenum]
addProp list, #pRolloverMember,\
[#comment: "掠过时显示的member(member)", #format: #member, #default

member]
addProp list, #pNormalMember,\
[#comment: "正常状态member(member)", #format: #member, #default: pmember]
return list
end getPropertyDescriptionlist
on mouseenter me
if pRolloverState = "Rollover Text" then
member(pTextMember).text = pRolloverText
else if pRolloverState = "Rollover Member" then
sprite(pRolloverSprite).member = pRolloverMember
end if
end mouseenter
on mouseleave me
if pRolloverState = "Rollover Text" then
member(pTextMember).text = pNormalText
else if pRolloverState = "Rollover Member" then
sprite(pRolloverSprite).member = pNormalMember
end if
end mouseleave