A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [F8] adding to sound to button

  1. #1
    Member
    Join Date
    May 2005
    Posts
    45

    [F8] adding to sound to button

    I have button that is a movieclip, it's a button that rolls in when you hover over it and rolls out when you click off it. How do I add a sound effect to the button.

    Code:
    stop(); 
    											 
    this.onEnterFrame = function(){
    	if(rewind == true){   
    		prevFrame();       
    	}
    }
    
    this.onRollOver = function(){
    	rewind = false; 
    	play();    
    }
    
    this.onRollOut = function(){
    	rewind = true;    
    }
    
    this.onRelease = function(){
    	
    }

  2. #2
    Senior Member
    Join Date
    Nov 2005
    Location
    dante's inferno
    Posts
    904
    that all depends on how you intend to place the sound.
    you can import it into flash and drop it in a frame on the timeline in the "down state" , you can set up a sound object and link to it externally.

    code:

    my_sound = new Sound();
    this.onRelease = function(){
    my_sound.loadSound('theSound.mp3', true);
    }


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center