property pSpeakPhrase -- the word or phrase to speak property pUseMouseClick -- activate only if the mouse is clicked property pUseMouseRollover -- activate only if the mouse is rolled over a sprite ------------------------------------------------------------ -- This behavior speaks a word or phrase when the mouse is -- either clicked on a sprite or frame, and/or rolled over -- a sprite. -- -- Ken Loge - http://diginoodles.com ----------------------------------------------------------- on beginSprite me -- check that speech services are available if not voiceInitialize() then if the platform contains "win" then alert "Please install the Windows Speech API to hear text to speech." gotoNetPage("http://www.microsoft.com/speech/") else alert "Please enable text-to-speech on your computer." end if end if end on getPropertyDescriptionList me list = [:] addProp list, #pSpeakPhrase, [#comment: "Word or Phrase to Speak:", #format: #string, #default: ""] addProp list, #pUseMouseClick, [#comment: "Speak on mouse click:", #format: #boolean, #default: 1] addProp list, #pUseMouseRollover, [#comment: "Speak on mouse rollover:", #format: #boolean, #default: 0] return list end on mouseUp me if pUseMouseClick = TRUE then speakPhrase(me) end if end on mouseEnter me if pUseMouseRollover = TRUE then speakPhrase(me) end if end -- initialize voice and speak the phrase on speakPhrase me voiceInitialize() voiceSpeak(pSpeakPhrase) end