property pMyForeColor -- the foreground color of the sprite property pHighlightColor -- the color palette value to use for a highlighted sprite property pSoundMember -- sound cast member to play property pSoundChannel -- sound channel property pSoundVolume -- sound volume property pFadeOutValue -- the number of milliseconds to use for sound fadeOut on beginSprite me -- store the original forground color of the sprite. -- shape objects or bitmaps work best for this. pMyForeColor = sprite(me.spriteNum).foreColor end ---------------------------------------------------------------------- -- This behavior works well for a virtual xylophone or piano. -- Use Director shapes, bitmaps, or vector shapes to draw the -- instrument "keys", then trigger any imported sound from the cast. -- -- Ken Loge - http://diginoodles.com ---------------------------------------------------------------------- on getPropertyDescriptionList me list = [:] addProp list, #pHighlightColor, [#comment: "Palette color index value for highlight:", #format: #integer, #default: 100, #range: [#min: 0, #max: 255]] addProp list, #pSoundMember, [#comment: "Sound to play on enterFrame:", #format: #sound, #default: ""] addProp list, #pSoundChannel, [#comment: "Play in sound channel:", #format: #integer, #default: 1, #range: [#min: 1, #max: 8]] addProp list, #pSoundVolume, [#comment: "Sound volume:", #format: #integer, #default: 255, #range: [#min: 0, #max: 255]] addProp list, #pFadeOutValue, [#comment: "Sound fadeout time (milliseconds):", #format: #integer, #default: 250, #range: [#min: 0, #max: 1000]] return list end on mouseEnter me sprite(me.spriteNum).foreColor = pHighlightColor sound(pSoundChannel).play(member(pSoundMember)) sound(pSoundChannel).volume = pSoundVolume end on mouseLeave me sprite(me.spriteNum).foreColor = pMyForeColor sound(pSoundChannel).fadeOut(pFadeOutValue) end