Flash error in AS3. Use a button to stop a sound.

Hi,
I have the following code:
import flash.net.URLRequest;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.events.Event;
import flash.events.MouseEvent;
var ruta:URLRequest=new URLRequest("afternoonnaps.wav");
var sonido:Sound = new Sound();
var canal:SoundChannel = new SoundChannel();
sonido.load(ruta);
sonido.addEventListener(Event.COMPLETE, carga);
function carga(event:Event):void {
detener_btn.addEventListener(MouseEvent.CLICK, detener);
function detener(event:MouseEvent):void {
canal.stop();
I want to stop a sound with a button and this is the error that I get:
Error #2044: IOErrorEvent Unhandled: text=Error #2032: Sequence or Stream error.
at web17_fla::MainTimeline/frame10()
Please, Can you help me?.

import flash.net.URLRequest;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.events.Event;
import flash.events.MouseEvent;
var ruta:URLRequest=new URLRequest("afternoonnaps.wav");
var sonido:Sound = new Sound();
var canal:SoundChannel;
sonido.load(ruta);
sonido.addEventListener(Event.COMPLETE, carga);
function carga(event:Event):void {
canal = sonido.play();
detener_btn.addEventListener(MouseEvent.CLICK, detener);
function detener(event:MouseEvent):void {
canal.stop();

Similar Messages

  • Disabling "Application Error" to restart using restart button in sxmb_moni

    Hi Experts,
    I have a scenario of JDBC to inbound Proxy.In this we have created Fault message type to capture any error.The requirement is to disable the option of Restart in SXMB_MONI for application error generated with Fault message.We have done coding for generating application error in inbound proxy code.Looking for a quick reply.
    I am looking for disabling the "Application Error" generated from Fault message of inbound proxy to "Resart" using Resart button in SXMB_moni of Application system ECC.what I am referring to is how to disable u201Crestartu201D (not resend) of the messages in SXMB_MONI if they have errors.
    For example, the interface to load some entries calls a proxy which may load some messages successfully and some may result
    in errors. This would appear in the SXMB_MONI with application errors with restart capability. If the user restarts the message it will post the entries again which were successfully posted earlier. We would like to prevent this from happening.
    I have gone through the below links.But no luck.Please suggest me if anyone know the solution/hint for this.
    Proxy framework: Catch CX_AI_SYSTEM_FAULT
    Re: SXMB_MONI - Message Status - Automatic Restart
    /people/sap.user72/blog/2005/11/29/xi-how-to-re-process-failed-xi-messages-automatically

    I do not think you could do that as Asyn messages are always restartable. May be you should look at changing the proxy code so that it does not through application errors but instead would update a Ztable with list of items need to be reprocessed. And this can be sent to the JDBC system as reprocess request.
    VJ

  • General Error or Crash using menu button on chapter playlists

    This is my first complex project in 2.0 - I needed to have approx 120 clips playable individually from a series of still menus. Given the 99 timeline limit, I created a number of timelines and placed batches of clips on them. I'm then using individual chapter playlists to reference each clip. The chapter playlist is linked from a menu button.
    When using the menu remote button when a chapter playlist is playing, I either get an 'abnormal condition' error, or occasionally, Encore crashes with no message at all. Tried this with no menus, timelines and playlists open but same errors.
    More detail:
    PAL 16:9 project
    28 timelines
    65 chapter playlists
    15 still menus
    approx 120 mpv clips and associated wavs (mpv encoded with cinemacraft encoder sp)
    Settings for one of the clips giving problems:
    Timeline - end action not set, menu remote - return to last menu, all ops permitted, no chapter end actions
    Chapter playlist - end action - return to last menu, override not set, menu remote - return to last menu, all ops permitted.
    I think I can stop the errors and crashes if I disable the menu remote button - but I don't really want to do this.
    Any ideas what's going on? Is it a bug(S)?
    Thanks,
    Paul.

    Paul.
    The trouble I had was the "Abnormal Condition" error when hitting the menu remote button in preview.
    There was no problem with Prev/Next buttons though.
    I tried burning a disc too, just to check if it would burn true & just played up in preview - but no dice. What happened was the player froze up solid after pressing the menu remote.
    I did create another project where the chapter playlists numbered around 28 from a single timeline, and this actually worked as it should do, so I suspect an issue in Encore's internal stacks where this is all addressed.
    I had to use a different application in the end.
    I believe the reason yours is still failing is simply because despite having 5 timelines, you are still well over the number of chapter playlists that seem to be available.
    It's a nasty bug - but apparently a fix is in the works. Hopefully we will see this as a maintenance release - we got these with both earlier versions (1.01 from 1.0, and 1.5.1 from 1.5) so I am hoping it will happen.
    There are a couple of issues I have noticed - although this is so far the only one I cannot work around in my projects.
    One thing has just occurred to me that might help you here.
    Instead iof using a chapter playlist to reference each clip, save these for multiple clips that need to be accessed, and from your chapter menu, just point directly to the clip in question.
    Set an end action for each clip to revert back to the menu that called it, and create just a single chapter playlist for a "Play All" situation.
    This will greatly reduce the number of chapter playlists you are running - and should do the job for you.

  • Error Message when using menu buttons in IE but not chrome

    Hi.
    My recently uploaded site has an issue when using the menu buttons anywhere on the site in Internet Explorer but not on my mac using chrome? I get this error message come up on screen which takes three clicks to go away  MuseJSAssert: Error calling selector function:TypeError: Object doesn't support property or method . Then if I click anything else it pop ups again. Any ideas how to get rid of this? I have tried re-uploading the muse files but the same happens. I even tried uploading the files from a different exported frm muse folder as I saw had worked for someone else on here but no difference? Any help much appreciated.
    Website : vanletteringco.com
    You may get an error that iPage are sorting when opening too, just delete the /root1 in the address bar to see the site?
    Thanks
    Gav

    Hello,
    I am only getting the MuseJSAssert error on the contact page of your site when viewed in Internet Explorer.
    And as I can see you have used a webform from Jotforms which I suspect might be creating issues here.
    I would suggest you to remove the form  once and then upload your website again. if it starts working fine then get the Embed code of your form again from Jotforms and insert it again to check if it works fine or not.
    Please let us know the results of the testing.
    Regards,
    Sachin

  • Animated Flash Component Scaling when used as Button Skin

    I am trying to skin the overSkin of a Flex Button component with an animated Flash .swc component. (Actually, an Accordion Header, but for all practical purposes the same.)
    All works completely fine, in most cases.  The problem I run into is when I have any objects in the Flash animation moving on and off stage.  When this happens, although the objects cannot be seen when moved off-stage, the viewable area of the Flash animation scales down in either direction, or both, to make room in the button for the objects off stage.
    If I play the animation directly in the application, or a Canvas, everything works fine and no scaling occurs.  But for a Button, where I really need it, I get the constant scaling back and forth as the Flash movie runs.  This can be REALLY annoying when trying to click on a button! (Or you find that you are no longer "over" the button (because it scaled down) so you get flicker back and forth between the Up and Over states.)
    Any ideas on how I can keep this from happening, either on the Flash or Flex side would be much appreciated.
    Pertinent Code:
    [Bindable]
    [Embed(source="assets//btn_StaticHollywood.jpg")]
    private var Film:Class;
    [Bindable]
    [Embed(skinClass="fc.HollywoodWithSearchlights")]
    private var FilmOver:Class;
    animatedButton.setStyle("upSkin", Film);
    animatedButton.setStyle("overSkin", FilmOver);
    <mx:Button id="animatedButton" cornerRadius="0" />
    Note: I tried all assortments of setting dimensions I believe.
    Remember, the Flash component has objects that move in and off the stage from both directions, and this is the cause of the automatic resizing of the Button when it runs.

    I am assuming that you are using Flex 4 and this does not work. In Flex 4, the default theme used is the "Spark" theme. In Flex 3, we used the "Halo" theme. The Halo theme supports styles like borderStyle, but, the Spark theme does not.
    If you want to use these styles, you will need to compile with the Halo theme. You can do this by adding an additional compiler argument -theme=<SDK_DIR>/frameworks/themes/Halo/halo.swc (point to the halo.swc in your SDK installation)
    Joan

  • Toogle button to stop/start sound

    I'm looking for code to create toggle button that will start
    and stop sound.
    thank you

    http://www.kennybellew.com/tutorial/
    Chris Georgenes
    Adobe Community Expert
    www.mudbubble.com
    www.keyframer.com
    www.howtocheatinflash.com
    pmck wrote:
    > I'm looking for code to create toggle button that will
    start and stop sound.
    >
    > thank you

  • Errors when using Spark Buttons in dynamically loaded modules loaded by dynamically loaded modules

    Ok ... I have to admit this issue is rather special ;-)
    I have a flex application that loads a list of modules after the user logs in, depending on the permissions of the user.
    One of these modules contains a component, that allows the user to configure settings for different types of objects.
    For each object type (can be extended) there exists one module swf.
    The strange problem I am having now is that as soon as a Spark Button (or anything derived from one ... CheckBox) inside the settings-module. I get the following error (unfortunately in german ... but I'll try to translate).
    This error happens when using a spark CheckBox (Which is derived from Spark Button):
    ArgumentError: Error #2004: Einer der Parameter ist ungültig.
    at flash.display::Graphics/drawRect()
    at mx.graphics::RectangularDropShadow/drawShadow()[E:\dev\4.x\frameworks\projects\framework\ src\mx\graphics\RectangularDropShadow.as:575]
    at mx.skins.spark::BorderSkin/updateDisplayList()[E:\dev\4.x\frameworks\projects\sparkskins\ src\mx\skins\spark\BorderSkin.mxml:174]
    at mx.core::UIComponent/validateDisplayList()[E:\dev\4.x\frameworks\projects\framework\src\m x\core\UIComponent.as:8709]
    at mx.managers::LayoutManager/validateDisplayList()[E:\dev\4.x\frameworks\projects\framework \src\mx\managers\LayoutManager.as:663]
    at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.x\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:718]
    at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.x\frameworks\projects \framework\src\mx\managers\LayoutManager.as:1072]
    When having a look at the problem the cause is that width and height are not set (NaN).
    If I use a plain Button I get the same error in "drawRoundRect".
    As soon as I change back to a mx-Button/Checkbox, everything is fine.
    In my current Case I wanted to use a custom TreeItemRenderer to display a CheckBox in the tree. This tree Item renderer is included in a custom Lib that is used by all modules.
    I have one Second Level module using this renderer. I have one Third Level Module thas uses the exact same tree definition. If I use the MX CheckBox I get CheckBoxes in the Second- and Third-Level Module. If I use the Spark-CheckBox I get a CheckBox in my Second Level Module and the above Error in the Third Level Module.
    To make everything even stranger: I have a custom component loading my modules and I use this in the Top Level Module to load the Second Level Modules and in my Second Level Module to load my Third Level Modules (So I would guess If my loader is broken, then the Second Level Modules should not work either).
    Help is greatly appreciated :-)
    Regards,
          Chris

    Ok, I managed to find out what was going wrong and to get my stuff working again. I have to admit that I have no idea why my application / flex was showing this behaviour. The only way I could track this down was by undoing the Subversion checkins one by one. Finding out what was happening using common sense seems to be out of the question with this issue.
    My application is built up of a main application swf that loads module swfs and a library swc that contains common stuff and is used in the main application and the modules.
    I now had some custom TreeItemRenderers in my modules. The problem was caused by moving a custom TreeItemRenderer from one module to the library-swc. I could successfully reproduce this. If I add only one class extending TreeItemRenderer to my library (I don't even have to use it), the entire flex system goes haywire. As soon as I remove that class, everything is ok. I checked, if there might be a problem with third party libs containing flex core classes which might be used instead of the sdk ones, but after looking at the catalogs of the third party swcs I couldn't find a reference to TreeItemRenderer.
    Any Ideas? I sort of dislike the idea of being able to run into such strange problems. Is there a tool that allows me to check for class compatibility issues?

  • I am getting a error IO when trying to upload multiple images within wordpress using the flash uploader. I do not get the error when uploading using explorer. The error only appears if I try uploading using firefox....any ideas?

    I am getting a error IO when trying to upload multiple images within wordpress using the flash uploader. I do not get the error when uploading using explorer. The error only appears if I try uploading using firefox....any ideas?

    Logged the call with SAP who directed me to 'Define settings for attachments' in IMG and setting the 'Deactivate Java Applet' & 'Deactivate Attachment versioning' checkboxes - problem solved.

  • Print in A4 size paper through AS3 using Flash CS5

    Hi all,
    Is any idea to print a job in A4 paper size by defult through AS3 using Flash CS5?

    Hi Shakeel,
    I am already having customised page format .
    It works fine when I choose Standard Device type EPLQ550
          But EPLQ550 is probably not supporting Arabic text.   It Gives ########
    Thats why I changed to Standard Device type ARSWIN
        Now Arabic text looks ok..... but Printer is not getting initialised after the first check. it skps.
    Pl suggest
    Thanks
    SK

  • Im using firefox 4.0.1 and Idm 6.05, I get an error while i click download button.

    Im using firefox 4.0.1 and Idm 6.05, I get an error while i click download button.
    ERROR Displyed is : "cannot connect to dl120.duckload.com:80" and "permission denied. check your Firewall settings and ensure IDM has permits to access internet"
    But i have disabled Windows firewall and i dont have Antivirus.. Plz help me...
    For more plz see tis screen shot : [http://img845.imageshack.us/img845/5234/idmerr1.png link text]

    See if the "stable" version released on 30 June is compatible with Firefox 5.0. That page doesn't mention which versions of Firefox it is compatible with, a serious oversight, IMO. <br />
    https://www.torproject.org/torbutton/
    Plus, it looks like that developer hasn't updated his AMO page in over a year, which makes it impossible for users of that add-on to get automatic updates as each new version of Firefox is released. <br />
    https://addons.mozilla.org/en-US/firefox/addon/torbutton/

  • ActionScript doesn't seem to work in my trial cc version of flash professional, sometimes I use cs5.5 related AS3

    Who can explain what I need to do when actionScript doesn't seem to work in my trial cc version of flash professional, sometimes I use cs5.5 related AS3?
    thanks for a reply,
    mike

    did you get my earlier message? Here's what I wrote;
    I also meant to add the way the instructor for the course showed how to
    write the code
    for example;    home_btn.addEventListener(Mouse...................) as so
    on You mention no period after the btn unless a width or something how
    could I change the code to be proper.
    and also one for {
    content_pg.gotoAndStop(2);
    same period example. should there be a space and no period after home_btn?
    thanks again for your assistance.
    mike
    On Wed, Aug 27, 2014 at 7:00 PM, -mikey1969- <[email protected]>

  • Hi, I am using a iphone 3g and i did not update it for 4 years now i have updated the software and the phone is not connecting to itunes with the error flashing error 11556

    Hi, I am using a iphone 3g and i did not update it for 4 years now i have updated the software and the phone is not connecting to itunes with the error flashing error 11556

    https://discussions.apple.com/thread/4977025

  • Flash CC: Load MovieClip using button

    Im here because im really stuck, and i need to finish my job quiclky.
    I never used FLash CC, I always used Flash 8... So much easy to load clips etc.
    Well, Here is the .FLA in Flash CC format so u guys can give me a little hand (please).http://www.sendspace.com/file/u6mh4p
    The thing that i want to do is: When i make click on button History (first button on the left side) "Not the logo" i Want to load MovieClip called History (stopped one).
    I really appreciate any help.
    Thanks in advance RushWHQ

    assign your button an instance name (done same way in cc as flash 8 - eg, history_btn) and assign your library movieclip a class (right click the library symbol >click properties>tick export for actionscript>enter a class name in the class field - eg, HistoryClass).  then in the actions panel, use:
    var history_instance:HistoryClass;
    history_btn.addEventListener(MouseEvent.CLICK,f);
    function f(e:MouseEvent):void{
    history_instance=new HistoryClass();
    addChild(history_instance);

  • The install now button keeps disappearing so I am unable to update my flash. I am using a Mac.

    The install now button keeps disappearing so I am unable to update my flash. I am using a Mac.

    Hi
    Can you please clear your browser cache and try again.
    --Gaurav

  • Using a button to open an SWF in the same player...

    Hello,
    I seem to be having some trouble figuring out the proper kind of script that would allow me to use a button to call up and play a new SWF in the exisiting player (in this case, the projector). I am working on an interactive presentation which is now complete. However, I need a splash screen that opens on launch which offer different langauges. Each langauge has its own swf. I need a menu on the splash screen that the user can use to select their langauge by clicking the respective button that lanches that particular swf. Right now, I just need one button as the other langauge versions are still in production.
    With that said, is there an easy way to launch an swf from the splash screen? I have tried a few different actionscripts but I seem to be always coming back to loadmovie script (which I havn't really mastered yet). My early attempts would load the new SWF but the current one stays in the player. It is kind of a mess.
    Anyway, I am hoping there is a simpler option. I am a beginner at actionscript 3, so I am still figuring things out. I have worked with AS1 and AS2 and it seems those versions were linked swfs easier that AS3. I just want the button to leave the existing player and open the new swf (but leave the splash screen behind). This would function like website navigation, so I am not needing anything fancy. Most of the documentation I have read so far either assumes you want the swf to import and be part of the internal navigation or want multiple swfs loaded internally. That is definitely not what I want.
    Anyway, thank you in advance for any help/insight.

    Well, I think I got it working. The code I came up with seems a lot more simple than what I was experimenting with. I am pretty sure I did something earlier that was similar to this code but the current swf stayed with the player when the new one loaded, I am pretty sure the old swf is hiding underneath the new one but after some testing, the actual presentation is working as intended so I am waving the AS3 white flag and am accepting how this functions in its present state. I nearly gave myself a heart attack trying to get this simple function to work
    Anyway, heres my "final" code. If anyone sees something that should be adjusted, please let me know.
    play_iv.addEventListener(MouseEvent.CLICK, loadmain);
    function loadmain(event:MouseEvent):void {
                var prevu_english:Loader = new Loader();
                prevu_english.load(new URLRequest("assets/PreVu - English.swf"));
                addChild(prevu_english);
    Also, Thankyou Ned. You pointed me in the right direction. If I didn't keep looking at the loader class, I probably would have spent days doing trial and error until I got somewhere.

Maybe you are looking for

  • Queries on Fusion P2P (on cloud) and Oracle GL (on premise) coexistence

    I have a few queries around co-existence model e.g Fusion P2P on Cloud with R12 GL on premise. In the Oracle Enterprise Repository (OER) , there is a scenario for coexistence solution of Fusion P2P (on cloud) with Oracle GL  (on premise). Assuming P2

  • Getting BAM Error

    Hi, We are getting below error in bam. Its intermittent, after bounce it works fine .... We are on 10.1.3 and using plan to pull data to populate data object. Please suggest ? Thanks in advance, 2010-07-13 13:14:29,295 [1220] ERROR - ActiveDataCache

  • Where should I to start ??

    Dear all, Where should I to start learn about SOA ? I found many terms here such as ESB, BPEL, and much more. Those technologies offer different approaches and I found no basic knowledge about this or I miss something ? May someone give me more basic

  • Simple Examples on ABAP Objects without using include or function modules

    Hi, I am new to ABAP. I need simple example codes on ABAP Objects. It should not have Includes or Function Modules. Just simple codes, using local & global classes, interfaces etc. I searched the forum and even <<the site that shall not be mentioned>

  • Sound is off Help!!!!

    Hi, I have a HP Pavilion dvd4-2145dx entertainment notebook.  I was fooling around with the microphone settings in my control/sound panel, and now i have no sound from my speakers.  I think I've changed a setting that has to do with adding a headphon