A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Play sound on rollover !

  1. #1
    Member
    Join Date
    Jun 2006
    Posts
    41

    Play sound on rollover !

    hi guys,

    Here's a problem. I am using a movieclip as a button. I want to play a sound from my library on the rollover position of that movieclip. what is the script?

    Jayhari

  2. #2
    Junior Member
    Join Date
    Jun 2006
    Posts
    5
    mate i would just put the sound inside th movie clip, does the movie clip play frames when u roll over it?
    if so that is an easy fix,

  3. #3
    Senior Member
    Join Date
    Jun 2006
    Posts
    100
    PHP Code:
    on(rollOver) {
        
    name of sound = new Sound()
        
    name of sound.attachSound("name in library")
        
    _root.name of sound.start()

    so an example would be:

    PHP Code:
    on(rollOver) {
        
    animal = new Sound()
        
    animal.attachSound("birdsound")
        
    _root.animal.start()

    In your library, go to the option called "Linkage" check the "Export for ActionScript" box and "Export in First Frame" then give it a name in the boxes above that, give it the same name in both. In the example above the "birdsound" is name name I gave the file in the "Linkage" menu. the "animal" is the new name for refering to it. If you want to you can name them the same thing. Hope that helps, - Peter.

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