Flash with background sound (I got error #2037)

Hallo.
I am a beginner at AS3 programming. I like to make a flash with background sound (*.mp3 files from *.xml list). Everything works fine, but when I press "onClick" button I got output error.
Error: Error #2037: Functions called in incorrect sequence, or earlier call was unsuccessful.
    at flash.media::Sound/_load()
    at flash.media::Sound/load()
    at proov_fla::MainTimeline/F_MP3_laadimine()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()
My Script:
var MP3_PLAYLIST:String = "playlist1.xml";
var LAADI_MUUSIKA:URLRequest;
var MUUSIKA:Sound = new Sound();
var MUUSIKA_KANAL:SoundChannel = new SoundChannel();
var HETKE_MUUSIKA:Sound = MUUSIKA;
var POSITSIOON:Number;
var HETKE_INDEX:Number = 0;
var KAS_MUUSIKA_MÄNGIB:Boolean = true;
var XML_FAIL:XML;
var MUUSIKA_NIMEKIRI:XMLList;
var MP3_LAADIJA:URLLoader = new URLLoader();
MP3_LAADIJA.addEventListener(Event.COMPLETE, F_MP3_laadimine);
MP3_LAADIJA.load(new URLRequest(MP3_PLAYLIST));
onClick.addEventListener(MouseEvent.CLICK, järgminelugu);
function järgminelugu(e:MouseEvent):void
    MP3_PLAYLIST = "playlist2.xml";
    MP3_LAADIJA.load(new URLRequest(MP3_PLAYLIST));
function F_MP3_laadimine(e:Event):void
    XML_FAIL = new XML(e.target.data);
    MUUSIKA_NIMEKIRI = XML_FAIL.track;
    LAADI_MUUSIKA = new URLRequest(MUUSIKA_NIMEKIRI[0].path);
    MUUSIKA.load(LAADI_MUUSIKA);
    MUUSIKA_KANAL = MUUSIKA.play();
My full purpose will look like this http://uusrand.pri.ee/galerii/proov/

Hallo.
Can anybody help me to add an actionscript line(s) into attach file "newXML.fla".
In this file I have a script to play mp3 files from xml list (this works).
I also add button to load new mp3 fileslist from new xml file. But I don't know how.
My Script:
var MP3playlist:String = "http://uusrand.pri.ee/mp3/playlist.xml";
var MP3file:URLRequest;
var MP3SoundURL:Sound = new Sound();
var MP3sound_channel:SoundChannel = new SoundChannel();
var xml:XML;
var playlist_index:XMLList;
var xml_loader:URLLoader = new URLLoader();
var MP3index:Number = 0;
xml_loader.addEventListener(Event.COMPLETE, originalXMLfile);
xml_loader.load(new URLRequest(MP3playlist));
onClick.addEventListener(MouseEvent.CLICK, nextXMLfile);
function nextXMLfile(e:MouseEvent):void
    if (MP3playlist == "http://uusrand.pri.ee/mp3/playlist_loodus.xml") {
        MP3playlist = "http://uusrand.pri.ee/mp3/playlist.xml";
    } else {
        MP3playlist = "http://uusrand.pri.ee/mp3/playlist_loodus.xml";
function originalXMLfile(e:Event):void
    xml = new XML(xml_loader.data);
    playlist_index = xml.track;
    MP3file = new URLRequest(playlist_index[0].path);
    MP3SoundURL.load(MP3file);
    MP3sound_channel = MP3SoundURL.play();
    MP3sound_channel.addEventListener(Event.SOUND_COMPLETE, nextSong);
function nextSong(e:Event):void
    if (MP3index < (playlist_index.length() - 1)){
        MP3index++;
    } else {
        MP3index = 0;
    var NextSongRequest:URLRequest = new URLRequest(playlist_index[MP3index].path);
    var NextSongURL:Sound = new Sound(NextSongRequest);
    MP3sound_channel.stop();
    MP3sound_channel = NextSongURL.play();
    MP3sound_channel.addEventListener(Event.SOUND_COMPLETE, nextSong);

Similar Messages

  • Newly installed Arch with gnome3 - Sound issue

    Hello fellow archs!
    I'm having such a huge issue at the moment with the sound.
    Got alsa installed, and alsaconfig cant find a thing on my motherboard.
    I will try to post the essential information so maybe someone will notice that I have done something wrong
    lspci | grep Audio
    00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 02)
    Now one wierd part:
    Doing aplay -l in gnome terminal
    aplay -l
    aplay: device_list:240: no soundcards found...
    Straight from terminal before starting gnome up
    **** List of PLAYBACK Hardware Devices ****
    card 0: Intel [HDA Intel], device 0: ALC889A Analog [ALC889A Analog]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 0: Intel [HDA Intel], device 1: ALC889A Digital [ALC889A Digital]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    I checked in modprobe and tried to follow the guide http://ubuntuforums.org/showpost.php?p= … ostcount=2 but couldnt find my ACL889 inside the list for model, I just tried something.
    # /etc/modprobe.d/modprobe.conf (for v2.6 kernels)
    alias snd-card-0 snd-hda-intel
    alias sound-slot-0 snd-hda-intel
    options snd-hda-intel model=6stack-dig
    blacklist snd_intel8x0m
    Please help! This new gnome3 looks really nice and nothing else except the sound issue seems to be wrong.
    Thanks.

    blargh wrote:
    Hey guys, thanks for the help...
    I was clicking around and noticed why i didnt get aplay -l correct. Wasnt it the group audio with my user..
    But! I noticed something. I can't add my soundcard as my default one, but I can sure see it in alsamixer if I pick it.
    I have been trying what the wiki been saying, either do it by kernel or use of the ~/.asoundrc which doesnt work as I get the message that the file is either to old or corrupted.
    lsmod|grep '^snd' | column -t
    snd_hda_codec_realtek 297871 1
    snd_hda_intel 22186 0
    snd_hda_codec 77703 2 snd_hda_codec_realtek,snd_hda_intel
    snd_hwdep 6342 1 snd_hda_codec
    snd_pcm 73736 2 snd_hda_intel,snd_hda_codec
    snd_timer 19488 1 snd_pcm
    snd 57384 6 snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_timer
    snd_page_alloc 7161 2 snd_hda_intel,snd_pcm
    ls -l /dev/snd
    total 0
    drwxr-xr-x 2 root root 60 Jun 16 18:23 by-path
    crw-rw----+ 1 root audio 116, 8 Jun 16 18:23 controlC0
    crw-rw----+ 1 root audio 116, 7 Jun 16 18:23 hwC0D2
    crw-rw----+ 1 root audio 116, 6 Jun 16 18:24 pcmC0D0c
    crw-rw----+ 1 root audio 116, 5 Jun 16 18:24 pcmC0D0p
    crw-rw----+ 1 root audio 116, 4 Jun 16 18:24 pcmC0D1c
    crw-rw----+ 1 root audio 116, 3 Jun 16 18:24 pcmC0D1p
    crw-rw----+ 1 root audio 116, 2 Jun 16 18:23 pcmC0D2c
    crw-rw---- 1 root audio 116, 1 Jun 16 18:23 seq
    crw-rw----+ 1 root audio 116, 33 Jun 16 18:23 timer
    Tried to remove pulseaudio by sudo pacman -Rd pulseaudio.. but it has so many depencies so it doesnt let me.
    Any Ideas?
    wrong approach - if using gnome-shell it does need to be there.
    I not only have an idea ~ but i do know how to fix your problem (i just need to read up, because off-hand i can't tell you how to do it).
    i ALWAYS disable PA - because it is crap!   i also think it is stupid that gnome -developers decided to make it a static dependency, when there are so many issues with it.
    i'll get back to you in a little while, okay?  (sometime later tonight, i just got home from work and need to relax / eat / etc..
    cheerz

  • Flash with frames

    I read a Flash with Frames tutorial and got what i wanted to
    do, but soon realized there was a problem. The code used only works
    with Actionscript 1.0. The code is: getURL("page.html","kirupa");
    where kirupa is the frame name. In actionscript 2.0, this page
    opens in a new window. I'm guessing there is a new way to do this
    in 2.0, any ideas???

    can you be more specific on what you are doing or using the
    code for?

  • Can KN3 export flash with sound?

    I'm working on a presentation in KN2 and I need to export a .swf file with sound on each slide. I know I can export to Quicktime with sound, but I'm working with another company that only accepts a .swf files.
    Is this fixed in KN3? Any suggestions on how to solve this in KN2?
      Mac OS X (10.4.4)  

    ok, I just bought KN3. Opened my KN2 file that has narration on each slide. Saved it in KN3. Exported to Flash with sound.
    However at the end I got a error box. "The following problems occurred while trying save document. Export Warning- A media file in slide 1 was not exported" This error occurred with all of my slides.
    My audio files were recorded in Quicktime 7.0 Pro as "mov". Should the audio files be saved as a different format for Exporting to Flash?
    Can "kworley" let me know the audio format that worked?

  • [SOLVED] FLASH and Mplayer automatic fasforward playing with no sound

    Hi,
    This has been the second time it happened.
    When I was playing some video at the background with SMplayer. All in a sudden, the playing stopped. I closed and restarted it:
    last time: the video  fast-forwarded automatically without any sound, same problem with VLC;  [the problem got "fixed" only after I rebooted my host Window 7; restarting the archlinux guest didn't help.]
    this time: VLC (there was an update in between) can play at a normal speed, but still no sound; as for smplayer, no sound, fastforwading automatically.
    And, in both times, flash in firefox fast-forwarded automatically with no sound.
    I have Archlinux/Xfce4 in virtualbox hosted by Windows 7. I have been using it for about one month. The problem occurred in last two days.
    Thanks,
    Last edited by hellolj (2014-01-16 12:21:30)

    damn!
    solved.
    restarted alsa in terminal.
    Last edited by hellolj (2014-01-16 12:33:57)

  • Desktop AIR 2.5 application with transparency and embedded Flash with wmode transparency error

    I'm working on a desktop AIR project using the 2.5 SDK (ADT) to create an application that combines html and flash content. My application is using systemChrome none and transparent true. I have an swf element in my html file that I have set to wmode transparent. Instead of the swf rendering with a transparent background and showing the desktop like the html content does, I'm seeing a black box that fills the area where the Flash element is embedded.
    Can someone please assist me in removing this black square so that my flash content is rendered within the html file with a transparent background instead of a black background?
    When the AIR application is set to transparent, the Flash content must have it's wmode set to either transparent or opaque. Opaque gives it a white background (the stage background color), but transparent seems to just give it a black background.
    Thanks!

    Ok fellas,
    It appears that I have indeed answered my own question. So thanks... uh, me As I've now figured out, the entire AIR application is basically still a Flash based Display Object, one that can render html using webkit. That means that even though my main application is written in HTML I can still load swf files into the display list of the root applications native window using the Loader class.
    I had mentioned earlier that this didn't work, but actually it did work I was just having an error. In my flash file I had a reference error because I was referencing stage.stageWidth in actionscript. This produces a typeError in the AIR runtime when I add this to the root display list. I was able to finally see this error by add the -nodebug command to my adl testing script (adl app.xml -nodebug). For whatever reason my AIR 2.5 adl would not produce air.trace calls to the cmd console without that -nodebug command, which is extremely ironic. So adding in the -nodebug command actually gave me my debug traces! Welcome to the world we live in folks... I also found out that my traces in the swf also trace out to the console when you add this command in there.
    In addition, the reason I was not able to get the Loader class to work from javascript was because I was not using the correct addEventListener call. If you are familiar with Actionscript 3.0 (which luckily I am) you will recall that you have to add the event listener to the "contentLoaderInfo" object of the Loader variable you instanciate.
    Here's a snippet of how I was able to do this as well as another link that is buried in the documentation that's useful:
    var loader;
    loader = new air.Loader();
    var file = air.File.applicationDirectory.resolvePath("test.swf");
    loader.contentLoaderInfo.addEventListener(air.Event.COMPLETE, swfLoaded);
    loader.load( new air.URLRequest(file.url) );
    function swfLoaded(evt) {
         air.trace(" SWF LOADED! Woohoo! ");
         air.trace( loader.numChildren );
         loader.width = 1000;
         loader.height = 800;
         loader.x = 0;
         loader.y = 0;
         window.nativeWindow.stage.addChild(loader);
    This is a very useful article on creating nativeWindows and other things, such as creating Flash based display objects and adding them to the stage:
    http://help.adobe.com/en_US/air/html/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7e0a.html
    Woohoo!

  • Error #2037 with no line reference

    Hello, its me again:
    I am working on my mp3 player and all is well up to when
    the current song plays or the user stops the song (stop() is
    called and song position is set to 0). The externalInterface
    is working, at least for the first time the user clicks play button.
    However, if the song is finished or the user clicks a stop button
    and tries to play the same song again the following error occurs:
    Error: Error #2037: Functions called in incorrect sequence, or earlier call was unsuccessful.
        at flash.media::Sound/_load()
        at flash.media::Sound/load()
        at player_fla::MainTimeline/playSound()
    Since there is no line number reference, it is unclear where the code is
    breaking down, beyond <soundObj>.load(urlRequest) (??)
    Once the selection is stopped or finished, does it have to be reloaded, or
    does it persist in memory? (Is there a way to explicitly remove it from memory
    and then reload it again?)
    Thank you for time and attention, suggestions.
    JK

    I solved this problem: there was an erroneous branching condition
    in the playSound() function that was causing the condition to always
    run the initial code and not the restarting code when the sound was
    already loaded. But it was a matter of feeling around in a dark room.
    JK

  • I am unable to register by Adobe flash builder 4.7 with the key i got from complimentary upgrade to Adobe Flash Builder 4.5

    I am unable to register by Adobe flash builder 4.7 with the key i got from complimentary upgrade to Adobe Flash Builder 4.5
    Please help

    Kind of.  I never actually solved the bug, but I did make it past the install. 
      Upon running Adobe Flash Builder 4.7 Plug-in Installer it appeared to crash and only load a blank screen with a single unclickable button.  It wasn't actually "hanging", and would react when I clicked on the program menu and moused over "Services".  This would allow my clicks and keystrokes to register with the program, but only after I mouse over the "Services" menu item.  For example, you need to click "okay", then mouse over "Services".  When you want to enter text you need to click in the text box, and mouse over "Services".  Then you need to type the text you want, and mouse over "Services" to see the text appear.  It's a PITA, but you can get through the install by doing this. 
      After installing the FB plug-in starting eclipse with editors open appeared to cause errors.  If this happens, this is because it seems that FB attempts to load when eclipse starts up.  Close all editors and restart eclipse.  The Welcome page for FB may pop open up.  At the bottom there is a check box that will keep that form loading - check it.  If the page does not open when eclipse starts, then open up an MXML file.  The Welcome page should load, and you can check the box. 
    I hope this helps you move forward.  Also, if you find an actual solution please let me know.

  • My old laptop crashed, and took my iTunes account with it.  I got a new laptop, and want to sync my iTouch to my new iTunes account.  It gives me an error message stating that I can't sync to multiple iTunes accounts, but I can't access my old one!  Help!

    My old laptop crashed, and took my iTunes account with it.  I got a new laptop, and want to sync my iTouch to iTunes.  It gives me an error message stating that I can't sync to multiple iTunes accounts, but I can't access my old one! 
    How can I get my new iTunes account to allow me to Sync my iTouch?  The only option it gives me is to "transfer purchases" from my iTouch to iTunes, but that is only about 25% of my iTunes library-most of it is CDs I have uploaded.  How can I Sync without losing all my music from my iTouch???
    Also, I have lectures and photos, etc. on my iTouch that I don't want to lose.
    I've tried a few of the iPod copy programs-the free ones and the ones you have to pay for, but I can't find one that will work for ALL my content on an iTouch.
    Right now, I can't get anything from my iTouch to iTunes, and I can't update my iTouch with my new iTunes purchases, so I'm stuck!  Help!

    Also-I tried to use my backup hard drive, but I wasn't able to drag/transfer/send/move any of my muic files onto my iTouch when the iTouch was connected to my computer.  I can't figure out why it won't let me do that. 
    The only thing I can see when I open my iTouch on my computer is my file with photos.  I can't see videos, music, or anything else.  What's going on?

  • When I am connected with Firefox I am hearing a background sound of a door opening and closing.

    Starting about one month ago I have been hearing a background sound of a door opening or closing. When opening, it is the sound of a latch turning and then a creaking door sound, and when closing it is the sound of a slamming latch.It is intermittent, ocurring every 5-10 minutes or so when connected with Firefox. There is no apparent problem associated with sounds, I'm just wondering why it's happening and what it might mean.

    Do you have that problem when running in the Firefox SafeMode? <br />
    [http://support.mozilla.com/en-US/kb/Safe+Mode] <br />
    ''Don't select anything right now, just use "Continue in SafeMode."''
    If not, see this: <br />
    [http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes]

  • ERROR while uploading the data into ztable with background processing

    Hi gurus,
    i am trying to upload the data from excel file to internal table 
    its working fine ..
    but........
    if i try to upload the data with background processing , in sm37 it is saying "error during the upload of clipboard contents".
    Regards,
    Sri

    Hi,
    FM GUI_UPLOAD doesnt work in background, use dataset to upload it from application server.
    refer below code
    *--Local Variables
      DATA : l_file  TYPE string,
             l_line  TYPE string,
             l_index TYPE sy-tabix.
    *--Clear
      CLEAR : l_file.
      l_file = p_ipfile.
    *--Read the data from application server file.
      OPEN DATASET l_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc NE 0.
    *--Error in opening file
        MESSAGE i368(00) WITH text-005.
      ENDIF.
    *--Get all the records from the specified location.
      DO.
        READ DATASET l_file INTO l_line.
        IF sy-subrc NE 0.
          EXIT.
        ELSE.
          SPLIT l_line AT cl_abap_char_utilities=>horizontal_tab
                          INTO st_ipfile-vbeln
                               st_ipfile-posnr
                               st_ipfile-edatu
                               st_ipfile-wmeng.
          APPEND st_ipfile TO it_ipfile.
        ENDIF.
      ENDDO.
    Regards,
    Prashant

  • When syncing with itunes, got error message saying had error and now ipad2 will not do anything other than showing the USB cable with arrow pointing to Itunes on screen.  have done the reset and restart, but still get same thing.

    when syncing with itunes, got error message saying had error and now ipad2 will not do anything other than showing the USB cable with arrow pointing to Itunes on screen.  have done the reset and restart, but still get same thing.  Ipad does not show up in itunes even though cable plugged in.  Have shut down and restarted Windows 7 computer.

    I had done all of that to no avail.  I did call Apple Tech Support and after he suggested I try a USB port in the rear of the Win 7 computer, things starting working again.  I had tried switching the USB port at the front of the machine but that had not helped.  Everything is good to go again.  thanks for  your reply

  • Tried to update to newest version. I got error because i didn't have this recovery program disc that was supposed to come with the purchase but it didn't and now my ipod touch 8gb won't connect with itunes and is stuck on a connection with itunes screen

    I tried to update to newest version via pc. I got error because i didn't have this recovery program disc that was supposed to come with the purchase so it says, but it didn't and now my ipod touch 8gb won't connect with itunes anymore and is stuck on a screen displaying an itunes icon with a usb icon.

    oke i'm not done with the whole thing, but i'm doing that right now. Most of the advice I've already read didn't work and at a certain point it said something about shutting down programs then restart. but i notice that there are some pretty important system things in that list and i don't want to mess up my pc :s i'm not a pc genius... and because i'm dutch and my pc-language is in dutch I often have trouble translating and well... i don't always understand the technical stuff in all the articles -_-

  • Connecting my iPhone 4S with 3rd party composite cable; error "accessory not supported by iphone".  Sound comes through and it charges but NO Video???

    Connecting my iPhone 4S with 3rd party composite cable; error "accessory not supported by iphone".  Sound comes through and it charges but NO Video???  I have verified the cable, I can play video with sound from iPod Nano 4th gen.

    composite don't support mirror so it will only display on the tv when the app being used support tvout option
    the build in video app does so it should display on the tv at least my composite cable does with my iphone4
    the audio always works it's pretty much works like a headset

  • During recovery on iPhone 4 I got : The iPhone could not be restored. Un unknown error occurred ( 3004 ). Then - iTunes has detected an iPhone in recovery mode. You must restore this iPhone before it can be used with iTunes.Then I get error 3004

    During recovery on iPhone 4 I got : The iPhone could not be restored. Un unknown error occurred ( 3004 ). Then - iTunes has detected an iPhone in recovery mode. You must restore this iPhone before it can be used with iTunes.Then I get error 3004 again. Latest iTunes and OS updates. I cant use the phone now. I did restart the destop,unplug the usb,...etc. Same iTune logo ,arrow and USB on the screen.THANK YOU SO MUCH,...!

    Perhaps the information in this Apple support article will help:
    http://support.apple.com/kb/TS3694#error3004
    Regards.

Maybe you are looking for

  • Office Add-In Not Working After Installing Office 2013

    I just installed Office 2013 on my Windows 7 Pro desktop with Acrobat X Pro installed and all of the Office Add-In's went away.  I find them very useful and would like to know how I can get them working again. Thanks.

  • How can I change my email on iCloud that is not verified yet

    I can't change my email on iCloud and the email on iCloud is not verified

  • How can I prevent sites from opening private windows?

    Many websites, such as Moodle (classroom tool) and YouTube try to open certain new content, especially Google-hosted content, in private windows. In may cases, such as YouTube comment panes, there is now way to avoid this, and even if there is I forg

  • Adobe Illustrator crashing

    I've downloaded the trial of Adobe Illustrator to teach myself some of the basics before looking into buying the software. Everytime I place an image and then try and shrink it to fit the 7.5 x 4.75 inch ad I am creating, Illustrator crashes. What am

  • RunInstaller on Linux dies...

    When I execute runInstaller on RedHat 6.1 I get the following: [sneaker@basset oracle]$ ./runInstaller Initializing Java Virtual Machine from /usr/local/jre/bin/jre. Please wait... Error in CreateOUIProcess(): -1 : Bad address [sneaker@basset oracle]