SoundChannel event.sound_complete does not? Help?

Hello

For some reason, my soundchannel event.sound_complete does not work. In fact, my class is to import its in and to allow the use to change their volumes and sound technology.

This is the tutorial for speed

http://blog.Andre-Michelle.com/2009/pitch-MP3/

Right now, what I want to do is to auto loop back the song once the song ended the game, but I saw troubled do. No matter which, can help me?

The code will pass by the SoundForward() function

Inside, it will trigger _mp3.addEventListener (Event.COMPLETE, complete);

and the activity function Rollback() will.

Inside, it will trigger a _soundChannel.addEventListener (Event.SOUND_COMPLETE, loopMusic);

but then the function fires once the song ended he played.

Benson

Thank you

------------------------------------------------------------------------------------------ -----

{package examples

import flash.display.Sprite;
import flash.events.Event;
import flash.events.SampleDataEvent;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.net.URLRequest;
import flash.utils.ByteArray;

SerializableAttribute public class SoundForward extends Sprite
{
private const blockSize:int = 3072;

private var _mp3:Sound;
private var _sound:Sound;
private var _soundChannel:SoundChannel;

private var _target:ByteArray;
private var _position:Number;
private var _rate:Number;
private var _stop:Boolean;


private var _pausePoint:Number;

public void SoundForward (url: String, stop: Boolean)
{
_target = new ByteArray();

_mp3 = new Sound();
_mp3.addEventListener (Event.COMPLETE, complete);
_mp3. Load (new URLRequest (url));

_stop = stop;

_pausePoint = 0;
_position = 0.0;
_rate = 1.0;

_sound = new Sound();
_sound.addEventListener (SampleDataEvent.SAMPLE_DATA, sampleData);

_soundChannel = new SoundChannel();

}

private void complete(event:Event):void
{
_soundChannel = _sound.play ();
_soundChannel.addEventListener (Event.SOUND_COMPLETE, loopMusic);
}

private void sampleData(event:SampleDataEvent):void
{
Reuse instead of leisure
_target.position = 0;

Shortcut
var data: ByteArray = event.data;
var scaledBlockSize:Number = blockSize * _rate;
var positionInt:int = _position;
var alpha: Number = _position - positionInt;

var positionTargetNum:Number = alpha;
var positionTargetInt:int = - 1;

need var: int = Math.ceil (scaledBlockSize) + 2;
var read: int = _mp3.extract (_target, need, positionInt);

var n: int = read is need? blockSize: read / _rate;

var l0:Number;
var r0:Number;
var l1:Number;
var r1:Number;

for (var i: int = 0; i < n; ++ i)
{
If (int (positionTargetNum)! = positionTargetInt)
{
positionTargetInt = positionTargetNum;

Reading objective FIXED position
_target.position = positionTargetInt < < 3.

Read Stero two samples for linear INTERPOLATION
L0 = _target.readFloat ();
R0 = _target.readFloat ();

L1 = _target.readFloat ();
R1 = _target.readFloat ();
}

Write amplitudes interpolated streaming
data.writeFloat (l0 + alpha * (l1 - l0));
data.writeFloat (r0 + alpha * (r1 - r0));

Increase the position of the target
positionTargetNum += _rate;

FRACTION OF THE INCREASE AND THE CLAMP BETWEEN 0 AND 1
+= Alpha _rate;
While (alpha > = 1.0)-alpha;
}

-FILL the REST OF THE flow of DATA WITH zeros
If (I < blockSize)
{
While (I < blockSize)
{
data.writeFloat (0,0);
data.writeFloat (0,0);

++ i ;
}
}

-INCREASE SOUND POST
_position += scaledBlockSize;
}

private void loopMusic(e:Event):void
{
trace ("AB");
}

}
}

Use the code that I have suggested.  You should have only one sound (_mp3) instance in your code.

Tags: Adobe Animate

Similar Questions

  • Browser is stuck in mode full screen, restart does not help.

    I entered the mode full screen on a website and now cannot get out. Restarting my computer does not help. Problem is that when you are using Firefox, no other browsers. Firefox continues to open full screen mode whenever I open it, and I have to reboot in order to use another browser.

    Try to rename (or delete) the file xulstore.json in the Firefox profile folder.

    You can use this button to go to the Firefox profile folder currently in use:

  • Thunderbird won't open on a local folder. No other window, no access to the accounts. Reinstall does not help.

    I have 4 accounts and about 30 local folders. Thunderbird is stuck with an open local folder. Cannot access any other page, or all accounts. Reinstall does not help, or don't restart the computer. I have Thunderbird 31.5.0 on Yosemite 10.10.2.

    Turn your folders pane. Component presentation-file to display if you are using the menu bar.

    If you use the AppMenu button it is button AppMenu
    Hover over the Options
    Component layout page-folder

  • Print Help does not help me open downloads on my android

    Cannot retrieve or open downloads. Printed text does not help because I can't find the button

    You are able to use the menu in Firefox for Android? On some devices, a stack of 3 points appears at the right end of the address bar to display the menu, while on other devices, there is a button to (touch capacitive) of 'material' to the camera button at the home to show the menus.

    In the menu, you should find under Tools downloads.

    In addition, by default, Firefox uses the download system folder, so if you open the download application that comes with your device you should find them there (in general).

    A little luck?

  • Firefox works too slowly. I have reset it. Update of plugins, but it does not help.

    Firefox worm 25.
    It downloads the pages slowly. I started it without plugins. I've updated all the plugins.
    Sometimes Firefox Watch window 'Script on this page may be busy... ". «The status line showes "transfer data of...» »

    I would like to thank Christophe.
    I did everything you mentioned, but it does not help.
    I found the solution. The steps are:

    1. 1 change of security for adobe flash in the C:\Windows\System32\Macromed\Flash\mms.cfg file add the line ProtectedMode = 0
    2. 2. set in Firefox Subject: config change dom.ipc.plugins.enabled to false and dom.ipc.plugins.java.enabled to true
    3. 3 disable hardware acceleration (advanced - general - settings)

    I guess only the first step and half of second if enough.
    We thank Assistant. My request can be closed.

  • Install new FF4, back/transfers and Refresh buttons does not - help!

    New installation of FF4.0 the forward/backward buttons and refresh from line. They do not work.

    I tried:

    restart
    relocation of
    start in safe mode
    remove places.sqlite and restart

    All to nothing does not. Any ideas anyone?

    Create a new profile as a test to see if your profile is the source of the problems.
    See:

    There may be extensions and plugins installed by default in a new profile, so check that in "tools > Modules > Extensions & Plugins»

    If this new profile works then you can transfer files from the old profile to the new profile (be careful not to copy corrupted files)

    See:

    If this does not help, then do a clean reinstall.

    • Uninstall your current version of Firefox and remove the Firefox program folder before installing this copy of the Firefox installer.
    • Do not remove the data of a personal nature if you uninstall the current version.
    • It is important to remove the Firefox program folder to delete all the files and make sure that there is no problem with the files that were the remains after uninstallation.

    Your bookmarks and other profile data is stored elsewhere (not in the Firefox program folder) and will not be affected by a relocation, but make sure that you do not select delete data of a personal nature if you uninstall Firefox.

  • I just ran the last update for my iPad and now it just continuously reboots to the black screen with the Apple Logo. Hard restarting does not help, neither do not connect the camera to MacBookPro. Any ideas?

    I just ran the last update for my iPad and now it just continuously reboots to the black screen with the Apple Logo. I left plugged in all night and still no change. Hard restarting does not help, neither do not connect the unit to aMacBookPro. When I do this, iTunes complains that it can not connect because the iPad 'expires '. Now it is disconnected, but I can't turn it off. Even close the lid will not extinguish it. Any ideas?

    Try the following. It seems yo may have to let the battery drain is completely:

    - iOS: do not respond or does not light

    -Also try DFU mode recovery mode post-test

    How to put iPod touch / iPhone in DFU "Karthik doodles."

    -If failed and that you cannot completely turn completely the iOS device, leave the battery to drain completely. After loading a hour repeat the foregoing.

    -Try a different cable

    -Try on another computer

    S ' there is still not successful that usually indicates a hardware problem and an appointment at an Apple store Genius Bar is in order.

    Shop Apple Store - Genius Bar

  • shortcut for deskjet 8600 pro has disappeared. Re-run the installation program does not help. How can I get that back?

    When I bought and installed my Pro Deskjet 8600 in last July, a wonderful control program has been installed. However, the shortcut on the desktop for this program has disappeared, and I can't. Re-run the installation program does not help. How can I get that back. All I have now is an older version of the HP Solution Center, which does not have the features that I got into the habit of.

    Hello

    Uninstall the software by following programs > HP > HP Officejet Pro 8600 > Uninstall.

    Then download and install the latest version of the software below, it is a more recent software and should solve the problem you are experiencing:

    http://h10025.www1.HP.com/ewfrf/wc/softwareDownloadIndex?softwareitem=bi-108858-3&cc=us&DLC=en&LC=en&OS=4131&product=4323659&sw_lang=

    Shlomi

  • Smartphones blackBerry sync error, took place - you try to synchronize again. But a resynchronization does not help.

    Hello support,

    I use my MAC for the BlackBerry Desktop Manager 1.0.3 (16) for Mac. I've updated my BB9700 5.0.0.351 to 5.0.0.59 3. I use Mac OS x 10.63 32 bit. My Blackberry synchronization but calendar entries.

    I am a customer of T-Mobile. (Prosumer)

    When I try to synchronize my contacts with my Bold 9700, comes after a few seconds, the message "sync error has occurred - you try to synchronize again.» But a resynchronization does not help. A couple of contacts (20%) are transferred, so the process is canceled again and again. undecided

    Please help me!

    HI and welcome to the forums!

    An error is displayed during the synchronization after the default calendar service is changed on the BlackBe...

    Let us know how it goes!

    Thank you

    Bifocals

  • Applications in the cloud creative section does not help

    I can't download apps on my computer, why?

    If this does not help, explain what you see in the applications tab.

    Using creative cloud | Download error in the applications tab of Creative Cloud Desktop Application

  • Photoshop CS6 crashes when starting my Mac. Reset preferences does not help. Download CS6 again if I have my serial number? And what do I need to uninstall the version crashed everything first?

    Photoshop CS6 crashes when starting my Mac. Reset preferences does not help. Download CS6 again if I have my serial number? And what do I need to uninstall the version crashed everything first?

    Hi christophp,

    Yes, you can do this, please follow the steps.

    Uninstall the existing version for Photoshop

    Then use the Adobe CC cleaning tool to remove files left link: http://download.macromedia.com/SupportTools/Cleaner/mac/AdobeCreativeCloudCleanerTool.dmg

    Restart the system

    Follow the link and download Photoshop CS6: applications download Creative Suite 6

    Enter the serial number to activate it.

    Let us know if that helps.

    Kind regards

    ~ Mohit

  • My creative application cloud told me to update my Bridge of Photoshop and Lightroom. All updates failed. All attempts have failed. I got error 49, but again does not help. What now?

    My creative application cloud told me to update my Bridge of Photoshop and Lightroom. All updates failed. All attempts have failed. I got error 49, but again does not help. What now?

    (Other relevant data)

    I had some problems with Photoshop since the last update. Whenever I close, I get a pop up that tells me that the program has failed and is looking for a solution. Sometimes, it closes with the same pop up, when I completed a heavy task memory. I use Nik and it's at the end of certain operations of Nik she does this sometimes (rarely). I need to re - register every month because otherwise, he thinks I work with a trial version.

    Hello

    Open the Temp folder.

    Clear the contents of the Temp folder.

    Disable your Antivirus and firewall computer for awhile.

    Launch Desktop CC and try to download Apps.

    You can also consult the document below.

    Error downloading creative cloud applications

  • Update iOS yesterday again does not help Revel update.

    Yesterdays iOS update still does not help the revel update. Hoped Apple update would fix the path of Revel, but not so much.

    Please see the post below updates on the issue of the revel facilities:

    Problem installing Adobe Revel 2.3.2

  • The onDeactivate event handler does not work in InDesign CC. Why?

    Hi guys.

    I'm working on a script in Javascript for InDesign CC.

    The big problem is that the onDeactivate event handler does not work.

    Here is an example that works in InDesign CSx, but not in InDesign CC:

    #target indesign
    var w = new Window ("dialog", "Test onDeactivate");
    var et_1 = w.add("edittext", [undefined, undefined, 300, 30], "Lorem ipsum");
    var et_2 = w.add("edittext", [undefined, undefined, 300, 30], "Dolor sit amet");
    var st = w.add("statictext", [undefined, undefined, 300, 30], "CONSOLE:\r\r", {multiline: true});
    et_1.onDeactivate = et_2.onDeactivate = function(){
         st.text = "CONSOLE: I left the field with this text:\r\t«" + this.text +"»"; }
    var b_ok = w.add("button", undefined, "OK");
    w.show();
    

    The script displays a dialog with text edit fields window 2: when a field loses focus (by clicking on the other), the "CONSOLE" shows the text of the old domain.

    Adobe, please, solve this problem as soon as possible.

    Thank you.

    Giorgio

    This is a bug, and it has been reported. Please report it to yourself, more the better reports. It's no good Adobe invite you in this forum to fix something.

    Peter

  • SOUND_COMPLETE event trigger does not properly. Help, please.

    I know SOUND_COMPLETE event should be put after channel.play (). I don't know why it does not work. It only works if I play the song in the channel, but not songOut. The question is if I put the song in the channel that the equalizer does not work even if I add SampleDataEvent. Please help me.

    flash.media.Sound; import to import flash.events.MouseEvent;

    Import fl.controls.Slider;

    Import fl.events.SliderEvent;

    import flash.utils.ByteArray;

    import flash.events.SampleDataEvent;

    import flash.net.URLLoader;

    import flash.events.Event;

    import flash.net.URLRequest;

    import flash.media.SoundChannel;

    import equalizer;

    import flash.media.SoundTransform;

    External callers.

    ExternalInterface.addCallback("IsStatic",IsStatic) ("playStop", playStopCaller);

    ExternalInterface.addCallback("IsStatic",IsStatic) ("getPlaylist", getPlaylistCaller);

    ExternalInterface.addCallback("IsStatic",IsStatic) ("eqChange", eqChangeCaller);

    ////////////////////////////////////////////////////////

    ////////////////////////Listeners ////////////////////////

    addEventListener (Event.ENTER_FRAME, update, false, 0, true);

    addEventListener (Event.ENTER_FRAME, getPlaylistX, false, 0, true);

    playBtn.addEventListener (MouseEvent.CLICK, playButtonHandler);

    stopBtn.addEventListener (MouseEvent.CLICK, stopButtonHandler);

    //////////////////////////////////////////////////////////

    //////////////////includes//////////////////////

    EQ: Equalizer var = new Equalizer();

    var eqVector:Vector. < number > = new Vector. < number > ();

    eqVector [0] = 0;

    eqVector [1] = 0;

    eqVector [2] = 0;

    eqVector [3] = 0;

    eqVector [4] = 0;

    eqVector [5] = 0;

    eqVector [6] = 0;

    eqVector [7] = 0;

    eqVector [8] = 0;

    eqVector [9] = 0;

    eqVector [10] = 0;

    eqVector [11] = 0;

    eqVector [12] = 0;

    eqVector [13] = 0;

    eqVector [14] = 0;

    var ba: ByteArray;

    var song: Sound;

    var songOut:Sound;

    var _samples:ByteArray;

    var _sampleBufferL:Vector. < number > = new Vector. < number > ();

    var _sampleBufferR:Vector. < number > = new Vector. < number > ();

    var volumeAdjust:SoundTransform = new SoundTransform();

    var playlistLength:Number = 0;

    var playlist:Array;

    var playTest:Array = new Array("media/sounds/test1.mp3","media/sounds/test2.mp3","media/sounds/test3.mp3");

    var channel: SoundChannel;

    const BUFFER_SIZE:int = 2048; size of the output buffer

    const MIN_SAFETY_BUFFER:int = 1024; minimum collected entry before the beginning of the output

    var songName:String;

    var currentSong:Number = 0;

    var songUrl:URLRequest;

    ////////////////////////////////////////////////

    function playStopCaller(t:String):void {}

    If (t == "0") {}

    stopSong();

    }

    on the other

    If (t == "1") {}

    songName = new String();

    songName = playlist [currentSong];

    songUrl = new URLRequest (songName);

    playSong();

    }

    }

    function playButtonHandler(event:MouseEvent):void {}

    songName = new String();

    songName = playlist [currentSong];

    songUrl = new URLRequest (songName);

    playSong();

    }

    function stopButtonHandler(event:MouseEvent):void {}

    stopSong();

    }

    function rhyme (): void {}

    volumeAdjust.volume = 0.5

    Equalizer. Preamp = 0.5;

    song = new Sound();

    song.addEventListener (Event.COMPLETE, loadCompleteSong);

    Song.Load (songUrl);

    }

    function stopSong (): void {}

    Channel.Stop ();

    channel.removeEventListener (Event.SOUND_COMPLETE, checkTiming);

    }

    slider1.addEventListener (SliderEvent.CHANGE, slider1Handler);

    slider2.addEventListener (SliderEvent.CHANGE, slider2Handler);

    slider3.addEventListener (SliderEvent.CHANGE, slider3Handler);

    slider4.addEventListener (SliderEvent.CHANGE, slider4Handler);

    slider5.addEventListener (SliderEvent.CHANGE, slider5Handler);

    slider6.addEventListener (SliderEvent.CHANGE, slider6Handler);

    slider7.addEventListener (SliderEvent.CHANGE, slider1Handler);

    slider8.addEventListener (SliderEvent.CHANGE, slider2Handler);

    slider9.addEventListener (SliderEvent.CHANGE, slider3Handler);

    slider10.addEventListener (SliderEvent.CHANGE, slider4Handler);

    slider11.addEventListener (SliderEvent.CHANGE, slider5Handler);

    slider12.addEventListener (SliderEvent.CHANGE, slider6Handler);

    slider13.addEventListener (SliderEvent.CHANGE, slider4Handler);

    slider14.addEventListener (SliderEvent.CHANGE, slider5Handler);

    slider15.addEventListener (SliderEvent.CHANGE, slider6Handler);

    volSlider.addEventListener (SliderEvent.CHANGE, volSliderHandler);

    function slider1Handler(event:SliderEvent):void {}

    eqVector [0] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider2Handler(event:SliderEvent):void {}

    eqVector [1] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider3Handler(event:SliderEvent):void {}

    eqVector [2] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider4Handler(event:SliderEvent):void {}

    eqVector [3] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider5Handler(event:SliderEvent):void {}

    eqVector [4] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider6Handler(event:SliderEvent):void {}

    eqVector [5] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider7Handler(event:SliderEvent):void {}

    eqVector [6] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider8Handler(event:SliderEvent):void {}

    eqVector [7] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider9Handler(event:SliderEvent):void {}

    eqVector [8] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider10Handler(event:SliderEvent):void {}

    eqVector [9] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider11Handler(event:SliderEvent):void {}

    eqVector [10] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider12Handler(event:SliderEvent):void {}

    eqVector [11] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider13Handler(event:SliderEvent):void {}

    eqVector [13] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider14Handler(event:SliderEvent):void {}

    eqVector [14] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider15Handler(event:SliderEvent):void {}

    eqVector [15] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function volSliderHandler(event:SliderEvent):void {}

    volumeAdjust.volume = event.value/100;

    channel.soundTransform = volumeAdjust;

    }

    function sampleData(event:SampleDataEvent):void {}

    _SAMPLES = new ByteArray();

    var len:Number = song.extract (_samples, BUFFER_SIZE),

    i: int = 0,

    l:number,

    r: Number;

    If (len < BUFFER_SIZE) {}

    Len += song.extract(_samples,BUFFER_SIZE-len,0);

    }

    _SAMPLES.position = 0;

    While (I < BUFFER_SIZE) {}

    l = equalizer.applyFilter (_samples.readFloat ());

    r = equalizer.applyFilter (_samples.readFloat ());

    event.data.writeFloat (l);

    event.data.writeFloat (r);

    i ++ ;

    }

    }

    function loadCompleteSong(event:_Event):void {}

    songOut = new Sound();

    songOut.addEventListener (SampleDataEvent.SAMPLE_DATA, sampleData);

    Channel = songOut.play ();

    channel.addEventListener (Event.SOUND_COMPLETE, checkTiming);

    }

    function Update($e:Event):void

    {

    BA = new ByteArray();

    SoundMixer.computeSpectrum (ba, true);

    var eq1:Number = 0;

    var eq2:Number = 0;

    var eq3:Number = 0;

    var eq4:Number = 0;

    var eq5:Number = 0;

    var eq6:Number = 0;

    var eq7:Number = 0;

    var eq8:Number = 0;

    for (var i = 0; i < 64; i ++) {}

    EQ1 += b [i];

    }

    for (i = 64; i < 128; i ++) {}

    EQ2 += b [i];

    }

    for (i = 128; i < 192; i ++) {}

    EQ3 += b [i];

    }

    for (i = 192; i < 256; i ++) {}

    EQ4 += b [i];

    }

    for (i = 256; i < 320; i ++) {}

    EQ5 += b [i];

    }

    for (i = 320; i < 384; i ++) {}

    EQ6 += b [i];

    }

    for (i = 384; i < 448; i ++) {}

    EQ7 += b [i];

    }

    for (i = 448; i < 512; i ++) {}

    Eq8 += b [i];

    }

    If {(eq1/64 < 100)}

    var fxNr1:Number = eq1/64;

    }

    on the other

    fxNr1 = 100;

    If {(eq2/64 < 100)}

    var fxNr2:Number = eq2/64;

    }

    on the other

    fxNr2 = 100;

    If {(EQ 3/64 < 100)}

    var fxNr3:Number = eq3/64;

    }

    on the other

    fxNr3 = 100;

    If {(eq4/64 < 100)}

    var fxNr4:Number = eq4/64;

    }

    on the other

    fxNr4 = 100;

    If {(EQ 5/64 < 100)}

    var fxNr5:Number = eq5/64;

    }

    on the other

    fxNr5 = 100;

    If {(eq6/64 < 100)}

    var fxNr6:Number = eq6/64;

    }

    on the other

    fxNr6 = 100;

    If {(eq7/64 < 100)}

    var fxNr7:Number = eq7/64;

    }

    on the other

    fxNr7 = 100;

    If {(QE8/64 < 100)}

    var fxNr8:Number = eq8/64;

    }

    on the other

    fxNr8 = 100;

    var eqz1:Number = Math.abs (Math.round (fxNr1));

    var eqz2:Number = Math.abs (Math.round (fxNr2));

    var eqz3:Number = Math.abs (Math.round (fxNr3));

    var eqz4:Number = Math.abs (Math.round (fxNr4));

    var eqz5:Number = Math.abs (Math.round (fxNr5));

    var eqz6:Number = Math.abs (Math.round (fxNr6));

    var eqz7:Number = Math.abs (Math.round (fxNr7));

    var eqz8:Number = Math.abs (Math.round (fxNr8));

    ExternalInterface.call("saveglobalscore",score) ("as3_getEq", eqz1, eqz2, eqz3, eqz4, eqz5, eqz6, eqz7, eqz8);

    }

    function getPlaylistCaller(x:Array) {}

    playlist = x;

    var playlistLength = playlist.length;

    }

    function getPlaylistX (event): void {}

    playlist = playTest;

    playlistLength = playlist.length;

    trace (playlist. Length);

    }

    nextBtn.addEventListener (MouseEvent.CLICK, nextSongHandler);

    prevBtn.addEventListener (MouseEvent.CLICK, prevSongHandler);

    function nextSongHandler(event:MouseEvent):void {}

    If (currentSong < playlistLength-1) {}

    currentSong ++;

    songName = new String();

    songName = playlist [currentSong];

    songUrl = new URLRequest (songName);

    stopSong();

    playSong();

    }

    on the other

    If (currentSong == playlistLength - 1) {}

    currentSong = 0;

    songName = new String();

    songName = playlist [currentSong];

    songUrl = new URLRequest (songName);

    stopSong();

    playSong();

    }

    }

    function prevSongHandler(event:MouseEvent):void {}

    If (currentSong > 0) {}

    -currentSong;

    songName = new String();

    songName = playlist [currentSong];

    songUrl = new URLRequest (songName);

    stopSong();

    playSong();

    }

    on the other

    if(currentSong == 0) {}

    currentSong = playlistLength - 1;

    songName = new String();

    songName = playlist [currentSong];

    songUrl = new URLRequest (songName);

    stopSong();

    playSong();

    }

    }

    function checkTiming(event:Event):void {}

    ExternalInterface.call("saveglobalscore",score) ("console.log", "intra aici.");

    channel.removeEventListener (Event.SOUND_COMPLETE, checkTiming);

    If (currentSong < playlistLength-1) {}

    currentSong ++;

    songName = new String();

    songName = playlist [currentSong];

    songUrl = new URLRequest (songName);

    stopSong();

    playSong();

    }

    on the other

    If (currentSong == playlistLength - 1) {}

    currentSong = 0;

    songName = new String();

    songName = playlist [currentSong];

    songUrl = new URLRequest (songName);

    stopSong();

    playSong();

    }

    }

    use:

    flash.media.Sound; import to import flash.events.MouseEvent;

    Import fl.controls.Slider;

    Import fl.events.SliderEvent;

    import flash.utils.ByteArray;

    import flash.events.SampleDataEvent;

    import flash.net.URLLoader;

    import flash.events.Event;

    import flash.net.URLRequest;

    import flash.media.SoundChannel;

    import equalizer;

    import flash.media.SoundTransform;

    External callers.

    ExternalInterface.addCallback("IsStatic",IsStatic) ("playStop", playStopCaller);

    ExternalInterface.addCallback("IsStatic",IsStatic) ("getPlaylist", getPlaylistCaller);

    ExternalInterface.addCallback("IsStatic",IsStatic) ("eqChange", eqChangeCaller);

    ////////////////////////////////////////////////////////

    ////////////////////////Listeners ////////////////////////

    addEventListener (Event.ENTER_FRAME, update, false, 0, true);

    addEventListener (Event.ENTER_FRAME, getPlaylistX, false, 0, true);

    playBtn.addEventListener (MouseEvent.CLICK, playButtonHandler);

    stopBtn.addEventListener (MouseEvent.CLICK, stopButtonHandler);

    //////////////////////////////////////////////////////////

    //////////////////includes//////////////////////

    EQ: Equalizer var = new Equalizer();

    var eqVector:Vector. = new Vector. ();

    eqVector [0] = 0;

    eqVector [1] = 0;

    eqVector [2] = 0;

    eqVector [3] = 0;

    eqVector [4] = 0;

    eqVector [5] = 0;

    eqVector [6] = 0;

    eqVector [7] = 0;

    eqVector [8] = 0;

    eqVector [9] = 0;

    eqVector [10] = 0;

    eqVector [11] = 0;

    eqVector [12] = 0;

    eqVector [13] = 0;

    eqVector [14] = 0;

    var ba: ByteArray;

    var song: Sound;

    var songOut:Sound;

    var _samples:ByteArray;

    var _sampleBufferL:Vector. = new Vector. ();

    var _sampleBufferR:Vector. = new Vector. ();

    var volumeAdjust:SoundTransform = new SoundTransform();

    var playlistLength:Number = 0;

    var playlist:Array;

    var playTest:Array = new Array ("media/sounds/test1.mp3","media/sounds/test2.mp3", "media/sounds test3.mp3");

    var channel: SoundChannel;

    const BUFFER_SIZE:int = 2048; size of the output buffer

    const MIN_SAFETY_BUFFER:int = 1024; minimum collected entry before the beginning of the output

    var songName:String;

    var currentSong:Number = 0;

    var songUrl:URLRequest;

    ////////////////////////////////////////////////

    function playStopCaller(t:String):void {}

    If (t == "0") {}

    stopSong();

    }

    on the other

    If (t == "1") {}

    songName = new String();

    songName = playlist [currentSong];

    songUrl = new URLRequest (songName);

    playSong();

    }

    }

    function playButtonHandler(event:MouseEvent):void {}

    songName = new String();

    songName = playlist [currentSong];

    songUrl = new URLRequest (songName);

    playSong();

    }

    function stopButtonHandler(event:MouseEvent):void {}

    stopSong();

    }

    function rhyme (): void {}

    volumeAdjust.volume = 0.5

    Equalizer. Preamp = 0.5;

    song = new Sound();

    song.addEventListener (Event.COMPLETE, loadCompleteSong);

    Song.Load (songUrl);

    }

    function stopSong (): void {}

    Channel.Stop ();

    channel.removeEventListener (Event.SOUND_COMPLETE, checkTiming);

    }

    slider1.addEventListener (SliderEvent.CHANGE, slider1Handler);

    slider2.addEventListener (SliderEvent.CHANGE, slider2Handler);

    slider3.addEventListener (SliderEvent.CHANGE, slider3Handler);

    slider4.addEventListener (SliderEvent.CHANGE, slider4Handler);

    slider5.addEventListener (SliderEvent.CHANGE, slider5Handler);

    slider6.addEventListener (SliderEvent.CHANGE, slider6Handler);

    slider7.addEventListener (SliderEvent.CHANGE, slider1Handler);

    slider8.addEventListener (SliderEvent.CHANGE, slider2Handler);

    slider9.addEventListener (SliderEvent.CHANGE, slider3Handler);

    slider10.addEventListener (SliderEvent.CHANGE, slider4Handler);

    slider11.addEventListener (SliderEvent.CHANGE, slider5Handler);

    slider12.addEventListener (SliderEvent.CHANGE, slider6Handler);

    slider13.addEventListener (SliderEvent.CHANGE, slider4Handler);

    slider14.addEventListener (SliderEvent.CHANGE, slider5Handler);

    slider15.addEventListener (SliderEvent.CHANGE, slider6Handler);

    volSlider.addEventListener (SliderEvent.CHANGE, volSliderHandler);

    function slider1Handler(event:SliderEvent):void {}

    eqVector [0] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider2Handler(event:SliderEvent):void {}

    eqVector [1] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider3Handler(event:SliderEvent):void {}

    eqVector [2] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider4Handler(event:SliderEvent):void {}

    eqVector [3] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider5Handler(event:SliderEvent):void {}

    eqVector [4] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider6Handler(event:SliderEvent):void {}

    eqVector [5] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider7Handler(event:SliderEvent):void {}

    eqVector [6] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider8Handler(event:SliderEvent):void {}

    eqVector [7] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider9Handler(event:SliderEvent):void {}

    eqVector [8] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider10Handler(event:SliderEvent):void {}

    eqVector [9] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider11Handler(event:SliderEvent):void {}

    eqVector [10] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider12Handler(event:SliderEvent):void {}

    eqVector [11] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider13Handler(event:SliderEvent):void {}

    eqVector [13] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider14Handler(event:SliderEvent):void {}

    eqVector [14] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function slider15Handler(event:SliderEvent):void {}

    eqVector [15] = number (event.value) / 100;

    equalizer.eqGains = eqVector;

    }

    function volSliderHandler(event:SliderEvent):void {}

    volumeAdjust.volume = event.value/100;

    channel.soundTransform = volumeAdjust;

    }

    function sampleData(event:SampleDataEvent):void {}

    _SAMPLES = new ByteArray();

    var len:Number = song.extract (_samples, BUFFER_SIZE),

    i: int = 0,

    l:number,

    r: Number;

    If (len< buffer_size="" )="">

    Len += song.extract(_samples,BUFFER_SIZE-len,0);

    }

    _SAMPLES.position = 0;

    While (i< buffer_size)="">

    l = equalizer.applyFilter (_samples.readFloat ());

    r = equalizer.applyFilter (_samples.readFloat ());

    event.data.writeFloat (l);

    event.data.writeFloat (r);

    i ++ ;

    }

    }

    function loadCompleteSong(event:_Event):void {}

    Channel = song.play ();

    channel.addEventListener (Event.SOUND_COMPLETE, checkTiming);

    song.addEventListener (SampleDataEvent.SAMPLE_DATA, sampleData);

    }

    function Update($e:Event):void

    {

    BA = new ByteArray();

    SoundMixer.computeSpectrum (ba, true);

    var eq1:Number = 0;

    var eq2:Number = 0;

    var eq3:Number = 0;

    var eq4:Number = 0;

    var eq5:Number = 0;

    var eq6:Number = 0;

    var eq7:Number = 0;

    var eq8:Number = 0;

    for (var i = 0; i)<>

    EQ1 += b [i];

    }

    for (i = 64; I)<>

    EQ2 += b [i];

    }

    for (i = 128; I)<>

    EQ3 += b [i];

    }

    for (i = 192; I)<>

    EQ4 += b [i];

    }

    for (i = 256; I)<>

    EQ5 += b [i];

    }

    for (i = 320; I)<>

    EQ6 += b [i];

    }

    for (i = 384; I)<>

    EQ7 += b [i];

    }

    for (i = 448; I)<>

    Eq8 += b [i];

    }

    if(EQ1/64)<>

    var fxNr1:Number = eq1/64;

    }

    on the other

    fxNr1 = 100;

    if(EQ2/64)<>

    var fxNr2:Number = eq2/64;

    }

    on the other

    fxNr2 = 100;

    if(EQ3/64)<>

    var fxNr3:Number = eq3/64;

    }

    on the other

    fxNr3 = 100;

    if(EQ4/64)<>

    var fxNr4:Number = eq4/64;

    }

    on the other

    fxNr4 = 100;

    if(EQ5/64)<>

    var fxNr5:Number = eq5/64;

    }

    on the other

    fxNr5 = 100;

    if(EQ6/64)<>

    var fxNr6:Number = eq6/64;

    }

    on the other

    fxNr6 = 100;

    if(EQ7/64)<>

    var fxNr7:Number = eq7/64;

    }

    on the other

    fxNr7 = 100;

    if(eq8/64)<>

    var fxNr8:Number = eq8/64;

    }

    on the other

    fxNr8 = 100;

    var eqz1:Number = Math.abs (Math.round (fxNr1));

    var eqz2:Number = Math.abs (Math.round (fxNr2));

    var eqz3:Number = Math.abs (Math.round (fxNr3));

    var eqz4:Number = Math.abs (Math.round (fxNr4));

    var eqz5:Number = Math.abs (Math.round (fxNr5));

    var eqz6:Number = Math.abs (Math.round (fxNr6));

    var eqz7:Number = Math.abs (Math.round (fxNr7));

    var eqz8:Number = Math.abs (Math.round (fxNr8));

    ExternalInterface.call("saveglobalscore",score) ("as3_getEq", eqz1, eqz2, eqz3, eqz4, eqz5, eqz6, eqz7, eqz8);

    }

    function getPlaylistCaller(x:Array) {}

    playlist = x;

    var playlistLength = playlist.length;

    }

    function getPlaylistX (event): void {}

    playlist = playTest;

    playlistLength = playlist.length;

    trace (playlist. Length);

    }

    nextBtn.addEventListener (MouseEvent.CLICK, nextSongHandler);

    prevBtn.addEventListener (MouseEvent.CLICK, prevSongHandler);

    function nextSongHandler(event:MouseEvent):void {}

    If (currentSong<>

    currentSong ++;

    songName = new String();

    songName = playlist [currentSong];

    songUrl = new URLRequest (songName);

    stopSong();

    playSong();

    }

    on the other

    If (currentSong == playlistLength - 1) {}

    currentSong = 0;

    songName = new String();

    songName = playlist [currentSong];

    songUrl = new URLRequest (songName);

    stopSong();

    playSong();

    }

    }

    function prevSongHandler(event:MouseEvent):void {}

    If (currentSong > 0) {}

    -currentSong;

    songName = new String();

    songName = playlist [currentSong];

    songUrl = new URLRequest (songName);

    stopSong();

    playSong();

    }

    on the other

    if(currentSong == 0) {}

    currentSong = playlistLength - 1;

    songName = new String();

    songName = playlist [currentSong];

    songUrl = new URLRequest (songName);

    stopSong();

    playSong();

    }

    }

    function checkTiming(event:Event):void {}

    ExternalInterface.call("saveglobalscore",score) ("console.log", "intra aici.");

    channel.removeEventListener (Event.SOUND_COMPLETE, checkTiming);

    If (currentSong<>

    currentSong ++;

    songName = new String();

    songName = playlist [currentSong];

    songUrl = new URLRequest (songName);

    stopSong();

    playSong();

    }

    on the other

    If (currentSong == playlistLength - 1) {}

    currentSong = 0;

    songName = new String();

    songName = playlist [currentSong];

    songUrl = new URLRequest (songName);

    stopSong();

    playSong();

    }

    }

    and you will need a crossdomain permissions file if your sound is loading from another domain.

Maybe you are looking for