LoadSound

Hello,
I am wondering if anyone out there can help me!!! I'm in
desperate need of a fix for a sound problem i have. I know how to
fix this problem if i import the sound into the flash file. But i
cant do this with this example because the sound file is too
large!!
I have some sound files dynamically loaded into my flash file
using the loadSound("",false) command.
However i can't get the tracks to pause or fastforward or
rewind. Does anyone have any idea how i can do this?? Is there a
function out there somewhere that will help me, normally i just
speed up the frame rate or reduce for the fastforward/rewind
button, but i cant do this in this case as the sound is an external
mp3 file :|
Please help, i'm desperate!!???
Many thanks

I have tried using the position class to pause the sound
file, below is the code that i used, however it doesn't work, maybe
there is an error somewhere??
Many thanks
When i trace the variable soundPosition, in the pause button,
it is undefined, so i believe the code which isnt working is the
line "soundPosition = mySound.position" because if i set the
position to any random number, this works?!?

Similar Messages

  • SetVolume doesn't seem to work with loadSound

    I've been using Flash and the sound object extensively since
    v5 so this problem came as a huge surprise to me... I don't think
    I've ever encountered it before.
    I'm trying to send setVolume() commands to a sound object
    that is associated with an MP3 via loadSound(). I've tried
    streaming and non-streaming approaches with loadSound() and get the
    same results -- any changes applied to the sound object with
    setVolume are completely ignored.
    I can use the same code, replace loadSound with attachSound
    and everything works as expected (with sounds in the Library).
    However, with external MP3s and loadSound, the volume level
    defaults and cannot be changed. When I trace(getVolume()) it
    reports values between 0-100 so I know that aspect of the code is
    right.
    Am I missing something or is this just a task that can't be
    done with sounds that have been loaded from outside the SWF?

    I have many sounds in the file, and to manage this I've taken
    great pains to be sure that there are no scope issues.
    Everything worked fine when I used attachSound(). I switched
    to loadSound() only to help speed testing and development because
    it meant I wouldn't have to import, assign linkageIDs, and so on.
    There are going to be nearly 50 sounds in the complete project.
    While I'm still testing and re-arranging, anything that can help
    save some time and make development more flexible is in my best
    interest. Well, that is if it works as expected...
    Any other suggestions?

  • LoadSound not working in IE but works in Firefox??! Help!

    Greetings all,
    I've posted this in the general forum with no luck, so I
    thought I'd try here.
    Situation:
    A simple flash movie, using a loadSound method, works
    correctly in FireFox/Safari in our production environment, but IE
    will NOT play any sound.
    All browsers work just fine in our staging environment,
    suggesting a difference between these two systems.
    When loading the movie in IE, the progress bar jumps from 0%
    to 100%, which suggests it's found the file, but will never play
    it. In FF/Safari, the progress bar fills up gradually, as expected.
    I've tried adding the mp3 mime type to our Apache
    configuration (AddType audio/mpeg .mp3), which didn't seem to have
    an effect. Linking to the mp3 file in different ways--literal vs.
    relative--doesn't seem to have an effect.
    This bug is holding back a pretty major new site component,
    if anyone has ANY ideas, please let me know!!
    Matthew

    "OctavianMH" <[email protected]> wrote in
    message news:e1oprn$2cr$[email protected]..
    > Sorry, perhaps i was unclear. The servlet is outputting
    an XML feed, that
    > contains the PATH to the mp3 file.
    >
    >
    http://www.carnegiehall.org/AudioInfoServlet?event_id=3328
    >
    > The flash music player uses XMLConnector and DataSet
    components to grab the
    > XML from the servlet feed, and then populates the
    loadSound() call from that
    > data. Not that it matters, if this:
    >
    >
    http://www.carnegiehall.org/flash/sound_module_empty.swf
    >
    > won't work under IE, which doesn't have any of the
    component/xml complexity,
    > and simply tries to load the sound, then the read sound
    module certainly won't
    > work.
    >
    > The key is getting sound_module_empty.swf to work, if I
    can get it to work in
    > IE, I imagine the real thing will work too.
    >
    > Oi vey.
    >
    > The actual mp3 file is at
    http://www.carnegiehall.org/media/2006S0108M.mp3
    OK, yeah, I remember now. I looked at that before.
    I put your files on my server in the same folder arrangement
    that you have for a test..
    I only changed the code for the sound_module_empty.swf to
    point to my server like this:
    stop();
    s = new Sound();
    s.loadSound("
    http://www.kompanionkare.net/media/2006S0108M.mp3",
    true);
    It loads up and works fine from my server so it must be a
    server problem.
    http://www.kompanionkare.net/flash/sound_module_empty.html
    (I will delete the Files soon, just leaving up long enough
    for you to test)
    tralfaz

  • LoadSound IE cache problem

    I see there are a lot of postings on this topic, however I
    haven't found any resolutions that are working for me. Here is the
    situation. I have a main movie, that loads external .swfs and plays
    in a linear way, much like a slide presentation. There are back and
    forward buttons, that go from one slide to the next. In each
    external .swf I am loading an mp3 dynamically as an event sound in
    the first frame. Here's an example of the AS:
    this.my_sound = new Sound();
    this.my_sound.loadSound("screen2.mp3", false);
    this.my_sound.onLoad = function(){
    my_sound.start();
    gotoAndPlay(2);
    This all works fine when I upload the files, clear my cache,
    and go to the URL. When I refresh the browser, it stops working.
    When I use the forward or backward buttons, it also stops working.
    Pretty much any time I try to revisit this external swf after it
    initially plays, it won't play at all. I'm assuming this has
    something to do with the cache. It's only an IE problem so far as I
    can see. I don't have this problem in Firefox. I've tried giving
    the mp3 a different extension. Doesn't work. I've tried moving all
    the AS to the second frame. Doesn't work. Any help would be greatly
    appreciated.
    Thanks.

    inlineblue and Tracy,
    Came across this post while looking for a solution for the
    cache problem. I am using Flex 2.0.1.
    Q1) From what I understood is adding a parameter to the
    AC_FL_RunContent("src", "MainMod?version1.1",...) call in the HTML
    wrapper will make sure the latest content is downloaded to the
    browser. Does this mean when the next time my MainMod.mxml is
    changed, I need to make this V1.2.
    Q2) I only saw one occurance of AC_FL_RunContent call in my
    wrapper where it is referring my SWF file. This is the only place I
    need to keep changing whenever the mxml file is changed?
    Q3) Looks like I have to change all Wrapper files (if I have
    multiple .mxml files in my project). Is there any we can automate
    this?
    Do you have a sample that I could take a look at to
    understand what needs to be changed to fix the issue?
    Appreciate your help.

  • Rollover buttons to play sound using "loadSound"

    Hi, there
    I am seeking help with the following AS2 code. The target effect: Rolling over each of the two buttons on the main stage plays different sound. The code below works. However, I need to embed it in another application (Articulate) which doesnot allow the use of "_root" and "attachSound". I was recommended to use "loadSound" instead. However, not a coding person, I am at a loss.
    Can anyone help me to change the script below to remove "_root" and "attachSound" and use "loadSound" instead? Thanks so much!
    var mySound:Sound = new Sound();
    mcButton5.onRollOver = function() {
    _root.mySound.attachSound("sound1");
    _root.mySound.start();
    var mySound:Sound = new Sound();
    mcButton6.onRollOver = function() {
    _root.mySound.attachSound("sound2");
    _root.mySound.start();

    I finally got it work, using load Sound...
    Kglad, thanks for your great help, as always!
    mySound1 = new Sound();
    mySound1.loadSound("Sound1.mp3", false);
    mcButton1.onRollOver = function() {
    mySound1.start();
    mcButton1.onRollOut = function() {
    mySound1.stop();

  • Runtime Error with loadSound in Explorer

    This is a realy serius issue.
    I'm working in a player for my radio in http://radio.kamello.cl
    You can hear it with all browsers but explorer.
    I make step by step testing & the result it's this:
    when i put this in my flash movie explorer crashes:
    var my_sound:Sound = new Sound();
    my_sound.loadSound("http://audio.uctradio.cl/clone",true);
    only this...
    is not all the people who have the problem but a 80%
    what can i do???
    Thanks in advance.

    i make a new player in as3 & i have no problems...guys...i say it because is the flash player...
    as2 is a code accepted in flash player 10... don't give to others, your problems...
    ok...don't worry...but i know it's the flash player...
    if you try it as I try to use a player with sound in as2 may to have the same problem....that's it... if you want to care about it's your issue.
    thanks...
    only you need to put this in as2:
    var my_sound:Sound = new Sound();
    my_sound.loadSound("http://audio.uctradio.cl/clone",true);
    and you have in internet explorer your runtime error....
    open you mind....

  • Pausar sondio cargado con loadsound

    Hola amigos..
    Hace tiempo que no posteaba...pero os sigo leyendo..
    Necesito una ayuda urgente pues tengo que entregar un trabajo
    antes del dia
    1....osea que quiero acabarlo hoy sabado.
    para no tener que hacer nada mañana domingo...Menos
    rollos
    Cargo un sonido asi:
    sonido = new Sound()
    sonido.loadSound("misonido.mp3",true);
    sonido.start()
    Como podria poner un boton de pausa....y que al clicar
    continue por donde
    iba...(el boton lo se hacer...)
    He buscado en google pero los ejemplos que me aparecen no son
    exactamente
    esto..
    Y no tengo tiempo....Bueno si puede ser..
    Y FELIZ Y MUY PORVECHOS AÑO NUEVO A TODOS
    CT

    Probalo y sino avisame que te envío uno de ejemplo a tu
    privado.
    "CT" <[email protected]> escribió en el mensaje
    news:flj7bi$ohp$[email protected]..
    > gracias Bigote..
    > Acabo de llegar de unas minivacaciones
    > Lo estudiaré, aunque en la web de marras ya lo he
    puesto que se pare..da
    > igual.
    > Gracias y de paso a todos y feliz año nuevo
    > CT
    >
    >
    > "BIGOTE" <[email protected]>
    escribió en el mensaje
    > news:fl662g$i4b$[email protected]..
    >> Aquí tenés para armar uno con pausa
    >>
    http://www.elrincondelprogramador.com/default.asp?pag=articulos/leer.asp&id=47
    >>
    >>
    >>
    >>
    >>
    >> "CT" <[email protected]> escribió en el
    mensaje
    >> news:fl5t99$91m$[email protected]..
    >>> Hola amigos..
    >>> Hace tiempo que no posteaba...pero os sigo
    leyendo..
    >>>
    >>> Necesito una ayuda urgente pues tengo que
    entregar un trabajo antes del
    >>> dia 1....osea que quiero acabarlo hoy sabado.
    >>> para no tener que hacer nada mañana
    domingo...Menos rollos
    >>>
    >>> Cargo un sonido asi:
    >>> sonido = new Sound()
    >>> sonido.loadSound("misonido.mp3",true);
    >>> sonido.start()
    >>>
    >>> Como podria poner un boton de pausa....y que al
    clicar continue por
    >>> donde iba...(el boton lo se hacer...)
    >>>
    >>> He buscado en google pero los ejemplos que me
    aparecen no son
    >>> exactamente esto..
    >>> Y no tengo tiempo....Bueno si puede ser..
    >>>
    >>> Y FELIZ Y MUY PORVECHOS AÑO NUEVO A TODOS
    >>> CT
    >>>
    >>
    >>
    >
    >

  • LoadSound from URL

    In AutoScript 2 how can I play music from URL?
    mySound = new Sound();
    mySound.loadSound("");
    and now how?

    use:
    mySound = new Sound();
    mySound.onLoad=function(){
    mySound.start()
    mySound.loadSound("your url");

  • LoadSound MP3 Catch

    Hey All,
    I have a flash MP3 player. Users upload an MP3 file and then
    it is streamed back.
    The file on the server is always saved with the same name no
    matter what their original file name was. So, when they reload an
    MP3 they need to hear it, which means that the url for the
    loadSound is always the same.
    The problem is that sound is obviously is in catch and until
    I close the browser the newly uploaded MP3 doesn’t play --
    instead the file that was loaded first is playing. I checked it
    from different perspectives and made sure that the file on the
    server is the latest one. Again, once I restart the browser
    (refresh doesn’t work) – correct file is played.
    What would be a technique that would refresh the file that is
    played if I pass the same URL through loadSound?
    Sorry for the redundancies.
    Thank you!

    Sadly, you cannot do this. It's a long standing player
    problem.
    It's essentially the same as this technote:
    " Unloading from Loader instances does not close net streams"
    http://www.adobe.com/go/6a360ede)
    That said, I need to dig up more detail than the above and
    see if there's anything Sound class specific that I'm not
    remembering..

  • To loadSound or attachSound

    Hi - Could someone please explain the difference/advantages
    for loadSound and attachSound. What's the "best practise" on when
    to use which?
    I've been trolling around and found 2 ways to get a sound to
    play onRelease. I don't see a difference.
    Thanks fr your expert input.
    JL

    JL,
    > I set up 2 btns on the stage using the same sound - a
    very short
    > whoosh (actually copies of the same sound). I know now
    that
    > one btn is "attaching" the sound from the Library while
    the other
    > is "loading" it from the relative folder in the FInder.
    Okay.
    > Here's the thing - they sound different.
    Attached sounds will be regulated by your global sound
    settings (see
    File > Publish Settings > Flash tab, Audio stream and
    Audio event buttons)
    or individually on the sound assets themselves (right-click /
    Command-click
    each asset and choose Properties). Loaded sounds sound like
    whatever they
    sound.
    You'll need to pay attention to your sample rates to avoid
    speed-of-playback glitches (search "Importing sounds" in the
    Help panel).
    You're using ActionScript 2.0, so you may also want to check
    out these
    brief articles on the Sound class in general:
    http://www.quip.net/blog/2006/flash/actionscript-20/understanding-the-sound-constructor/
    http://www.quip.net/blog/2006/flash/how-to-toggle-sound-globally/
    http://www.quip.net/blog/2006/flash/how-to-pause-sound-and-resume/
    David Stiller
    Co-author, Foundation Flash CS3 for Designers
    http://tinyurl.com/2k29mj
    "Luck is the residue of good design."

  • Slow Audio with LoadSound Mp3

    PLease help. Im loading MP3s into my SWF using LoadSound.
    Nothing fancy. But the pitch of the audio is a couple of keys lower
    than it is on the actual MP3. I tried this with other MP3s, and the
    pitch shift happens
    Any ideas what is causing this?
    Thanks!
    RR

    "rring" <[email protected]> wrote in message
    news:e21mlo$mn6$[email protected]..
    > PLease help. Im loading MP3s into my SWF using
    LoadSound. Nothing fancy. But
    > the pitch of the audio is a couple of keys lower than it
    is on the actual MP3.
    > I tried this with other MP3s, and the pitch shift
    happens
    >
    > Any ideas what is causing this?
    >
    > Thanks!
    > RR
    Make sure the mp3 sample frequency is one supported by Flash.
    (11khz, 22khz or 44khz)
    All others will be re-sampled with unpredictable results but
    usually you get a pitch change.
    tralfaz

  • LoadSound doesn't support all device formats?

    According to the flash lite 2.x documentation. loadSound can
    load and play device sounds. This works fine with mp3 and smaf.
    However when trying to loadSound an amr audio (both NB and WB) I
    get a bad sound data error message (probelm with content: 7)
    Has anyone encountered this problem yet?

    Yes, this is an issue and there are other device sound
    formats that do not load in addition to AMR. I believe that Adobe
    does not have a way to poll the device about supported audio
    formats, so they have to rely on their own information which is
    incomplete. Hopefully this will be fixed in some future release.
    By the way, what phone are you testing that supports SMAF and
    FL2.0?

  • How Do I Use an External MP3 file Without Embedding it? (AS2)

    I am using Adobe Flash CS6 with ActionScript 2.0.
    I have compiled my project, and due the collection of embedded mp3 files (background music) I am using on various locations, my published swf file is over 12MB.
    To reduce the size, I placed all the mp3 fiels in the same folder as the swf file and removed all reference to them from the project.
    I then added this code to frame #1
    import flash.events.Event;
    import flash.media.Sound;
    import flash.net.URLRequest;
    var CreditsMusic:URLRequest = new URLRequest("NineWalkers.mp3");
    var s:Sound = new Sound(CreditsMusic);
    CreditsMusic.setVolume(50);
    CreditsMusic.start(0,1);
    Obviously, this is not working (I would not be posting here if it was).
    What am I doing wrong?

    I haven't look into the help documents (you can), but I see you mixing up AS2 and AS3 code, along with treating a URLRequest (AS3) as if it is a Sound object....
         CreditsMusic.setVolume(50);
         CreditsMusic.start(0,1);
    If you want to work with the Sound class in AS2 open the help documents and see what properties and methods are available for the Sound class and work things out from there.  If you search Google using "AS2 Sound loadSound" you might get some good info as well.

  • How can I stop streaming of a sound?

    Hello,
    after asking in another Forum without getting an answer, I'm
    now posting here:
    I have a Sound var and some buttons (mc's with eventhandlers)
    on the stage.
    I have an array including URLs of some mp3 files.
    For every mp3 there is one button.
    When a button is pressed, a "loadSound" starts with the URL
    of the pressed button. (streaming is on)
    Now I tried the whole thing with the Bandwithprofiler, where
    You see the streaming and its process.
    When I hit one button twice (or more, the number doesn't
    matter) the swf streams the SAME soundfile twice!
    This is not very good, becaus if someone hit the button a
    hundred times, the performance would become very low.
    So how can i get rid of this multiple streaming of sounds?
    One answer I already got, was to load a soundfile that
    doesn't exist what should kill the streaming process, but this
    didn't work.
    sorry for my bad English, I hope you understood it.

    use an if-statement to force execution of your loadSound(),
    at most, once.

  • Line in red doesn't work, why?

    var nbTunes:Number = 43;
    var listeTunes:Array = new Array();
    var noTune:Number= 1;
    var max:Number = 43;
    var pick:Number = -1;
    var tune:Sound = new Sound(soundloader_mc);
    for (var i:Number = 1; i <= max; ++i)
    do{
      pick = random(nbTunes) + 1;
      trace(pick);
    while(! this.Available(pick))
    listeTunes.push(pick);
    trace (listeTunes);
    this.Play();
    tune.onSoundComplete= function(){
    Next();
    btnStop.onRelease= function(){
    tune.stop();
    btnPlay.onRelease= function(){
    tune.start();
    btnBack.onRelease= function() {
    BackTrack();
    btnNext.onRelease= function() {
    Next();
    function BackTrack(){
    if (noTune > 1){
      noTune-= 1;
    else{
      noTune= max;
    this.Play();
    function Next(){
    if (noTune < max)
      noTune+= 1;
    else{
      noTune= 1;
    this.Play();
    function Play(){
    this.WriteTune();
    var addZero:String = "" ;
    addZero.String = (noTune - 1) < 10 ? "0" : "" ;
    trace("addZero: " + addZero.String) ;
    tune.loadSound("Track No" + addZero.String + listeTunes[noTune - 1] + ".mp3", true); 
    function WriteTune(){
    trackNumber_txt.text = noTune + " / " + max;
    function Available(choice:Number):Boolean{
    var isAvailable = true;
    for(var j:Number = 0; j < listeTunes.length; ++j){
      if (listeTunes[j] == choice){
       isAvailable = false;
    return isAvailable;

    Thanks, it works now.
    I'm trying to learn ActionScript3 while finding snippets of code on Google to help me get started, but I guess I end up with code from earlier versions of ActionScript w/out my knowledge.  It's not easy for me to distinguish between the versions as I'm a novice at this.
    Example, in the following code, bigNum does have a dot to it even though it is just a regular variable.
    playbutt.addEventListener(MouseEvent.CLICK, playSound);
    function playSound(e:Event):void
    SoundMixer.stopAll();
    var num:Number = Math.ceil(Math.random()*43);
    bigNum.text = num < 10 ? "0"+String(num) : String(num);
    var path:String = "Track No" + bigNum.text + ".mp3";
    trace(path);
    var s:Sound = new Sound(new URLRequest(path));
    s.play();
    SoundChannel(1).addEventListener(Event.SOUND_COMPLETE, playSound);
    Ron

Maybe you are looking for