Sometimes we may need to have a sound when we hover over something, i.e when a tooltip appears.
Actually this can be done easily by adding an eventListener to the corresponding control.
Take a look at the example.
This line is the important line.

      myLabel.addEventListener(ToolTipEvent.TOOL_TIP_SHOW, myListener);

The function myListener gets called when we hover over the label thus producing the sound.
What you have to do is to just copy and paste the following code to your file.



     private var myToolTipSound:Class;
     private var mySound:Sound;

     private function init():void {
        myLabel.addEventListener(ToolTipEvent.TOOL_TIP_SHOW, myListener);
        mySound = new myToolTipSound();
      public function playSound():void {;
     private function myListener(event:ToolTipEvent):void {


  1. Ebook Downloads June 16, 2011 at 11:31 am

    Would you be thinking about exchanging hyperlinks?

    • James June 16, 2011 at 7:44 pm

      Yes ofcourse.

      • Parthena September 3, 2011 at 11:45 pm

        BION I’m impsresed! Cool post!


Leave a Reply

Your email address will not be published. Required fields are marked *




Theme by HermesThemes

Copyright © 2018 CoderzHeaven. All Rights Reserved

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.