header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
Jim
Points:0
Posts:0
Answered

8/24/2010 10:17:17 PM

Title: Sound on tooltip


Is is possible to have a sound when showing tooltip on something?



1
Inder
Points: 2980
Posts:0
Accepted Answer
8/24/2010 10:27:20 PM



to play a sound on show tooltip event you can use the following code



<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="init()">
  <mx:Script><![CDATA[
     import mx.events.ToolTipEvent;
     import flash.media.Sound;

     [Embed(source="../assets/toolTipSound.mp3")]
     private var myToolTipSound:Class;
     private var mySound:Sound;

     public function playSound():void {
        mySound.play();
     }
     private function myListener(event:ToolTipEvent):void {
        playSound();
     }
     private function init():void {
        myLabel.addEventListener(ToolTipEvent.TOOL_TIP_SHOW, myListener);
        mySound = new myToolTipSound();
     }
  ]]></mx:Script>
  <mx:Label id="myLabel" toolTip="ToolTip" text="Mouse over me to hear tooltip sound"/>
</mx:Application>




Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 4+6 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions