A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: controlling music files

  1. #1
    Member
    Join Date
    Apr 2000
    Location
    Raleigh, NC
    Posts
    52

    controlling music files

    Hello,

    I have a music file that places and loops when my site loads. I would like to turn this loop off or reduce the volume when I push play to play another music file. How can I do this? The other music file is controlled using the flash media component. Btw, I have Flash 8.

    Thanks,
    tdsilk

  2. #2
    Senior Member Bernz's Avatar
    Join Date
    Jun 2005
    Location
    Mid-Eastern U.S.
    Posts
    161
    Put your looping sound inside a movieclip. Then, create a new Sound class object:
    code:
    music = new Sound(movieClip);


  3. #3
    Always learning
    Join Date
    Jan 2001
    Location
    Miami
    Posts
    133
    Use a listener object that will respond anytime you start playing the file with the media component.

    You could erase the else condition, which will start the loop back when you stop the other file.

    var listenerObject:Object = new Object();
    listenerObject.click = function(eventObj:Object) {
    if(myMedia_component.playing == true){
    myLoop.stop();
    }else{
    myLoop.start();
    }
    };
    myMedia_component.addEventListener("click", listenerObject);
    Inasite - left brain is always right
    www.inasite.com

  4. #4
    Member
    Join Date
    Apr 2000
    Location
    Raleigh, NC
    Posts
    52
    Hi Inasite,

    I'm pretty new to actionscript, so let me see if I understand you correctly. Are you saying that I need to place my sound loop in a MC called myLoop? Currently the sound loop is on a layer on the timeline. It's set as an event that loops 99 times. Also, is the myMedia_component in your post the linkid or component instance name for the sound playing in the Media player component? Thank you in advance for your help.

    tdsilk

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