Stop the sound from the external SWF

Here's my problem. I have a main.swf and I load an external audio player.swf. I need to stop the player.swf sound when I press a button on the main.swf. Not all the buttons just a few buttons. I have now, I have to put the code in each button. Thank you

have you tried stopAllSounds()

Tags: Adobe Animate

Similar Questions

  • Stop the external external SWF sound

    I'm working on the controls for an external swf. The external swf load an external audio file. The structure at the moment is

    extswf.swf contains mcSound that loads soundfile.mp3. extswf.SWF playback starts automatically when it is called.

    movieController contains the icons for the buttons play/pause. This is attributed to CntlClass.

    CntlClass load extswf.swf and control buttons play / pause.

    So far, the play buttons / break stop and start and stop the film, but not the sound. I know that I need to access the sound from the external swf channel and sound transformation allows you to change the volume. We know not how to access this channel.

    The examples that I think have integrated audio files. Also, the examples seem to use the main class for the external swf. My external swf is not a class file, so I have no idea what would be the main class.

    If someone has done this successfully, who would be willing to share?

    you follow my suggestion.  use:

    SerializableAttribute public class CntlClass extends MovieClip
    {
    public var loader: Loader;
    public var movie: MovieClip;

    public void CntlClass()
    {
    loader = new Loader();
    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, movieLoaded);
    Loader.Load (new URLRequest ("extswf.swf"));

    mcPlay.buttonMode = true;
    mcPause.buttonMode = true;
    mcPlay.visible = false;
    }
           
    public void movieLoaded(event:Event):void
    {
    film = MovieClip (loader.content);

    loader.removeEventListener (Event.COMPLETE, movieLoaded);

    stage.addChild (movie);
    mcPause.addEventListener (MouseEvent.CLICK, pauseSWF);
    }
              
    public void pauseSWF(event:MouseEvent_=_null):void
    {
    Movie.Stop ();
           MovieClip (loader.content).channel.stop ();
    mcPlay.visible = true;
    mcPause.visible = false;
    }

    In extswf.swf:

    var req:URLRequest = new URLRequest ("noise.mp3");
    var sound: Sound = new Sound();
    channel: var SoundChannel = new SoundChannel();

    function soundLoaded(event:Event):void
    {
    sound.removeEventListener (Event.COMPLETE, soundLoaded);
    channel = sound.play().
    channel.addEventListener (Event.SOUND_COMPLETE, otherStuff);
    }

    function otherStuff(event:Event):void
    {

    Channel.Stop ();
    channel.removeEventListener (Event.SOUND_COMPLETE, otherStuff);
    }

    sound.addEventListener (Event.COMPLETE, soundLoaded);
    Sound.load() (req);

  • Problem with the playback of the external SWF sound

    Hello

    I need to load the external SWF file, which contains the simple + audio image sequence. I used the MovieClipLoader class for this and also a preloader, where I check if I can run the SWF safely, without having to pause later and continue with loading. It works similar to video YouTube, where the video is buffered.

    The problem is that when I load the SWF file and run it, the audio start to play later. I tried more cases and the reason is that even if I load enough of the SWF, I can be certain I can start reading, because it is not enough for audio, if you start playing a little later. When I insert more, the audio begins to play immediately.

    So the question is, is there a way how can I check if the audio is loaded and ready to play?

    Thank you

    Michal

    If you can inspect the external swf fla enough to know that synchronize sound is set to stream, you should be able to look at the scenario where the sound is attached and determine the number of images, the sound is.

  • Preloader which modifies the external SWF files every 5 seconds

    Hello

    I made a web banner in flash that loads an external swf and another external swf changes after 5 seconds. The banner have a preloader, but the problem becomes when you load the first time. As sovereign wealth funds are not cached in the cache of the browser and yet, time 5 seconds start counting from the preloader, and when the external swf file, shows only 1 second rest and it is replaced by another. There is a way to 'freeze' the time for each external swf until it loads completely?

    The code that loads SWFs every 5 seconds (this code is placed in a layer of action):

    start of the code:

    var intervalId: number;
    var: number = 0;
    var maxCount:Number = 23;
    var duration: number = 0;
    var banners: Array = new Array)
    "abatrade.swf,"
    "bancobrasil.swf,"
    "caparao.swf,"
    "cedro.swf,"
    "cesama.swf,"
    "copasa.swf,"
    "damatta.swf,"
    "emtel.swf,"
    "engedrain.swf,"
    "extel.swf,"
    "feedback.swf,"
    "iti.swf,"
    "intermedium.swf,"
    "magnesita.swf,"
    "maquenge.swf,"
    "maxxdata.swf,"
    "orteng.swf,"
    "paiva.swf,"
    "paraibuna.swf,"
    "paraopeba.swf,"
    "sabesp.swf,"
    "serpro.swf,"
    "soll.swf,"
    'thawte.swf '.
    );

    function executeCallback(param:String) {}
    var duration: number = 5000;
    loadMovie (banners [count], loadmovie_mc);
    loadmovie_mc._x = 0;
    loadmovie_mc._y = 0;

    clearInterval (intervalId);
    if(Count < maxCount) {}
    Count ++;
    intervalId = setInterval (Thi, "executeCallback", duration, banners [count]);
    }
    else {}
    Count = 0;
    intervalId = setInterval (Thi, "executeCallback", duration, banners [count]);
    }
    }

    If (intervalId! = null) {}
    clearInterval (intervalId);
    }

    intervalId = setInterval (Thi, "executeCallback", duration, banners [count]);

    end of the code
    ----------------------------------------

    And the code to the preloader (this code I place in the movieclip that loads external SWF files):

    start of the code:

    {onClipEvent (enterFrame)}
    var gtT:Number = this.getBytesTotal ();
    var gtL:Number = this.getBytesLoaded ();
    var gtP:Number = int ((gtL/gtT) * 100);
    If (TWG > gtL) {}
    This ._alpha = 0;
    _root. Loader._alpha = 100;
    _root. Loader.bar._width = gtP;
    clearInterval (intervalId);
    } else {}
    This ._alpha = 100;
    _root. Loader._alpha = 0;
    intervalId = setInterval (Thi, "executeCallback", duration, banners [count]);
    delete onEnterFrame;
    }
    }

    end of the code

    Note that I tried to freeze the time using a clearInterval does in the second code, but he simply doesn't work...

    Any ideas? Thank you

    Edson

    Here's the correct code kglad send me. Thank you very much!

  • Loading and unloading of the external swf with buttons

    Alright. Here's the deal. I have 7 buttons on my main page, on the left side of the screen. I want the buttons to the external swf on the right to load and unload then when you push a different button. Should I make a table? Do I need a clip vacuum film to load each swf in?

    ///////////////Buttons/////////////////////

    graphics - load the thumbnail scroll bar

    mixed technique - load the thumbnail scroll bar

    photography - load the thumbnail scroll bar

    illustration - charge the miniature scroll bar

    Words - list history of charges

    Contact - contact information of charges

    charges about - bio

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

    Thanks for any help.

    If you are unable to publish for flash player 10, you will need to use the instead of unloadAndStop() unload() method.

  • How to use the external swf semi-transparent mask?

    I want to use the external swf semi-transparent mask for the smooth transition. I use

    clip.cacheAsBitmap = true;

    mask.cacheAsBitmap = true;

    clip.setMask (mask);

    Everything works fine. But when I use

    loadMovie ("http://www.url.com/movie.swf", "_root.clip");

    clip.cacheAsBitmap = true;

    mask.cacheAsBitmap = true;

    clip.setMask (mask);

    It does not work... What am I doing wrong?

    Well, if your loadMovie is on the same timeline as the code that you set as a mask, then you need not _root.

    And sorry, I forgot, there was a problem with the main mc of masking that loadMovie is load in. While I was doing was putting clip inside another mc and called as well as mc 'container' then my code would look like:

    masker.cacheAsBitmap = true;

    container.cacheAsBitmap = true;

    container.setMask (masker);

    container.clip.loadMovie ("movietoload.swf");

    Download two attached SWF files and open the main.swf to see.

  • poor quality than the external .swf

    Is this possible?

    using my main swf file, I want to load an external swf.

    I put the external swf to play in low quality with:

    _quality = "low";

    but when I play the main swf file, two video clips seem to inherit the same parameter.  They both play at the same quality.

    Can I do the main swf play high quality or average, while the external swf is down?

    Thank you

    Yes, you can do.

  • How to determine the total number of images in the external .swf file loaded

    I have to be able to load both external .swf files and make them play in order. To do this, I need to know the number of images in the first .swf file so I can check _currentframe against _totalframes to determine when he is finished playing so that I can load another.

    Most of the stuff I see indicate that _totalframes on an external .swf can be determined by loading the .swf in a container clip and then check using a listener in the .onLoadInit. Like this:

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

    this.createEmptyMovieClip ("tester_mc", 1);
    var mcListener:Object = new Object();

    mcListener.onLoadInit = {function (target_mc:MovieClip)}
    target_mc.onEnterFrame = function() {}
    If (this ._currentframe > = this ._totalframes) {}
    trace ("total frames =" + this ._totalframes);
    delete this.onEnterFrame;
    } else {}
    trace (target_mc._currentframe + "OF" + target_mc._totalframes);
    }
    }
    }

    var test_mc:MovieClipLoader = new MovieClipLoader();
    test_mc. AddListener (mcListener);
    test_mc.loadClip ("Ad_Group.swf", tester_mc);

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

    Unfortunately, this doesn't seem to work. The trace will always return a total number of frames of 1.

    I guess it's because the container clip has only 1 frame, and the external .swf timeline seems to be ignored.

    I would appreciate any ideas on how to raise the total number of frames of an external .swf file or, Alternatively, put it another way when it's done playing. (Not only the loading, but play until the end.)

    TIA,

    C

    I guess it's because the container clip has only 1 frame, and the external .swf timeline seems to be ignored.

    I wouldn't imagine. My guess is that the main scenario for the external swf file has only 1 frame and the rest of the animation is inside a movieclip in this timeline. You publish this swf? Can you open the FLA and check how many images is open on the main timeline?

    The approach that you have mentioned is about what there is. But he knows check a chronology. If there are many nested movieclips, it may be impossible to understand what timeline you really want to be 'THE' full chronology.

    If you have the FLA, you can have the video call function on the _root timeline which tells the main swf that has completed a movieclip or something like that.

    Also, I have in my head somewhere that I recently saw something that someone made similar to this one, but do not remember... If it appears in my head that I will post.

  • Preloader is running on top of the external SWF

    I have a very simple preloader that loads an external SWF. It almost works. :-)

    I find that the external SWF appears in the window - good - but the preloader continues to run on top of it - bad. I have attached the actionscript code that is in my preloader...

    To see it in action, go HERE.

    Thanks in advance!
    -bryan

    ================================================

    Thank you very much. But I think that I'm not sure why the progress bar is HERE. If the SWF file is loaded and appears in the window, why is the progress bar still there and running? Why didn't he go away? The progress bar is correct, and the SWF file is displayed even if it is only partially charged?

    I finally subordinate the visibility of the external SWF that it is fully charged - so bytesLoaded file< bytestotal,="" then="" the="" swf's="" visibility="" is="" set="" to="" false.="" maybe="" that's="" just="" kludge,="" but="" it="">

    Again, thank you for answering my question!

  • AS3: How to access and control embedded sounds in an external swf?

    I rarely use the sounds in AS3/Flash. I use Flash Pro CS6, but I can't seem to understand how access control (play, stop, etc) sounds embedded in a SWF external loading in the main SWF file.

    It is easy to control them when they are incorporated on the main swf. However, on a responsible external SWR, I get all sorts of errors. For this application, I really need to incorporate in the external SWF file.

    I've read several solutions, but none seems not to work.

    I integrate the sound file mp3 called soundSegment1.mp3 tool to import Flash CS6 and then open the properties panel actionscript Flash select the name of the class: SoundSegment1. Can I change the class ID and create a file named SoundSegment1.as, and it saved right next to my document class main.as in the same directory. The code for the SoundSegment1 class looks like this:

    package  {

       
    import flash.media.*;


       
    public class SoundSegment1 extends Sound
       
    {

           
    public function SoundSegment1 ()
           
    {
               
    // no code in here
           
    }


           
    public function playSound()
           
    {
               
    var soundSegment1:Sound = new SoundSegment1();
               
    var channel:SoundChannel = soundSegment1.play();
           
    }
       
    }
    }

    Then, in my main.as, I made several attempts to play this sound such as:

    var fileLocation:URLRequest = new URLRequest(SWFToLoad);

    loader.load(fileLocation);

    loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressListener);

    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeListener);

    loader.contentLoaderInfo.addEventListener(Event.INIT, initListener); 


    function initListener(e:Event):void // I also placed this code on the completeListener and it didn't work

    {

         loader.content.soundSegment1.playSound(); // doesn't work. 

    }

    I get:

    Line XXX 1061: Call to a possibly undefined method playSound through a reference with static type flash.display:DisplayObject.

    Otherwise, I also read that I should be able to do something like this anywhere in the Main.as file:

    var theClass:Class = Class(loader.content.getDefinitionByName("SoundSegment1")); var theSound:theClass = new theClass(); theSound.play()  //doesn't work either.

    I also tried on the completeListener:

    var TheClass:Class = e.target.applicationDomain.getDefinition("SoundSegment1") as Class;

    var theSound:TheClass = new TheClass();
    theSound
    .play()  //doesn't work either.

    I get:

    ReferenceError: Error #1065: Variable SoundSegment1 is not defined. at flash.system::ApplicationDomain/getDefinition()

    I'm stuck and I really need this to work. I would really appreciate your help.

    Thanks in advance for any help provided. I really need to make it work, because I can not simply incorporate into the main SWF or load them individually outside one by one.

    Thanks again!


    You can use the load and loadCompleteF below:

    var SWFToLoad: String =...;

    var s:String = "SoundSegment1";

    Load (SWFToLoad, s);

    function load (urlS:String, classS:String) {}

    var ldr:Loader = new Loader();

    ldr.contentLoaderInfo.addEventListener (Event.COMPLETE, function(e:Event){loadCompleteF(e,classS);});)

    LDR. Load (new URLRequest (URL));

    }

    function loadCompleteF(e:Event,classS:String):void {}

    var loadedAppDomain:ApplicationDomain = e.target.content.loaderInfo.applicationDomain;

    var C: Class = loadedAppDomain.getDefinition (classS) in class;

    var instance: * = new C();

    Sound (instance). Play();

    }

  • Action Script 3 Code to play and stop a file Fla or external Swf using game, stop button, in, the FLA file

    Thank you for all the answers before.

    I need a code Action Script 3 humbly for playing and stopping at a file Fla or Swf external button Play or Stop in Parent Fla or Swf file.

    I should have the opportunity to revisit the Fla of Parent file of the external file using the key.

    For example: I 'Introduction' Fla that has a button to play an external Fla called "set up."

    And in the 'set up' ALF, there is a button to play 'Introduction' in Florida.

    Kind regards

    God bless you

    the eaiest way is to use the content property of your charger (cast as sprite or movieclip) to reference the main storyline in the loaded swf file, and to use parent.parent to the timeliine of reference containing your charger (assuming that it has been added) go up again as the appropriate object.

  • Prevents the external SWF closure

    I spent two days on this problem and have founded TONS of threads that talk about this subject, but none who answer my exact situation. I apologize if that's the answer somewhere else, but here's my situation:

    I have a main FLA I have one of the three external sovereigns play random, via a Virgin video component (with an instance of movieTarget). Each individual swf has a stop(); on the last frame of each and when played separate main .fla very well from this stop.

    However once incorporated the main .fla, if you selected a swf file, it plays on the loop. I need to find a way to stop it. I added a loader code to my code main .fla to detect when the selected SWF is fully charged, but don't know where to go from here. I have attatched my control action script code.

    The bigger picture here, is that it will be incorporated into an html splash page that when one of these sovereign wealth funds play, will disappear in the Web site. The idea being that whenever a user comes to the site, a different intro will play and then go to the site. So if there is another, more easier way to achieve this, let me know.

    I thank anyone who takes the time to read this and help out. I can really use the help. Thanks in advance.


    I'M A FOOL.

    I solved the problem. In all my efforts and countless hours of troubleshooting to get this thing to stop a loop, I downloaded never once my new SWFS to the server. I always just imported in the main fla thought that is where they were shooting. In fact, because they are external loading SWF, they fired from the server. Things REALLY basic here.

    Thanks for your time to help. It was not everything is lost because I learned that the film was double loading from one of your answers.

    Thank you again...

  • MainTimelime ContextMenuItem MENU_ITEM_SELECT event not sent the magazine containing the external SWF

    1. custom context menu applied to MainTimeline
    2. using a Loader() to load an external SWF and have it added to its container display string
    3. Make a right-click SWF loaded menu contextual custom appears, but the MENU_ITEM_SELECT events are not dispatched when the user clicks on the items
    4. click right on elsewhere in the parent SWF works great, even on deep nested objects (not externally loaded)
    5. Remove loaded SWF of the display string and right clicking in its location very good

    I managed to find a hack . On the charger () parent display object, I put:

    .mouseEnabled = false;

  • How to make reference to the external SWF file using if statement?

    I have a main swf file that loads several external SWF file when the user clicks a menu button. Now I want to target a specific swf file to Add an extra library child or of another swf when this specific swf file is loaded. How should I do? What should I put in the stated case?

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

    var newswf:URLRequest = new URLRequest (".") ("/ swf /" + event.target.name + ".swf");

    Loader.Load (newswf);

    addChild (loader); dynamically load SWFs

    If (newswf == ".") ("/ SWF/pubResCHETNA.swf ') //error here

    {

    FC.buttonMode = true;

    FC.addEventListener (MouseEvent.CLICK, full screen);

    }

    function fullScreen(e:MouseEvent):void

    {

    var loaderF:Loader = new Loader();

    loaderF.load (new URLRequest ("PopupFullscreen.swf"));

    addChild (loaderF);

    }

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

    The State must be newswf.url == the path. However I store event.target.name as a variable and use it in the State. You use "." for your path so the condition probably will always fail.

    --

    Kenneth Kawamoto

    http://www.materiaprima.co.UK/

  • How to unload the external .swf file when pass the other section?

    Hello

    The following code provided by Mr. kglad works very well to load an external .swf file on stage. Now, when I click on Contact (button), the file external .swf to disappear completely. How to encode on contact (button) to get by.

    Gallery.addEventListener (MouseEvent.CLICK, GalleryClick);

    function GalleryClick(e:Event):void {}

    If (currentClip! = Gallery_mc) {}

    currentClip.visible = false;

    Gallery_mc. Visible = true;

    currentClip = Gallery_mc ;}

    var loader: Loader = new Loader();

    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, ClipLoaded);

    Loader.Load (new URLRequest ("Gallery.swf"));

    function ClipLoaded(e:Event):void {}

    Gallery_mc. AddChild (Loader);

    Loader.x = 0;

    Loader.y = 120;

    Loader.Width = 1000;

    Loader.Height = 700

    }}

    I tried the following code for Contact_btn unload the Gallery.swf file that launches an error message: 1120: access of undefined property loader.

    Contact.addEventListener (MouseEvent.CLICK, ContactClick);

    function ContactClick(e:Event):void {}

    If (currentClip! = Cotnact_mc) {}

    currentClip.visible = false;

    Cotnact_mc. Visible = true;

    currentClip = Cotnact_mc;

    Gallery_mc.removeChild (loader);}}

    unloadAndStop() is supported by flash player 10 or higher (fp 10 +).

    p.s. Please check the useful/correct, if there is.

Maybe you are looking for

  • Question about brightness of the display on the Satellite L650

    Recently, I have a Toshiba Satellite L650-12 q. For the first time I used the laptop for a long time, for example 2 hours and I realized that after an hour and a half of the brightness of the screen automatically augmented or contrast so increased. W

  • Qosmio G30-155 Vista and cannot install XP

    Hello I have G30/155 laptop with pre-installed Vista and I want to install XP on the second HD (D :).How can I do? The stop to start installation process.When I put the installation CD, the installation does not start!The media are OK and CD/DVD driv

  • the external drive BIOS boot option usb missing

    I am trying to boot from an external USB device.  I have a DELL with a Pentium M with WINDOWS XP.  I entered Setup via pressing F2 at startup.  I changed the BOOT SEQUENCE so that a USB storage device is top of the list.  I rebooted the computer & F1

  • Change user name

    I misspelled my name when I entered as a user.  How can I correct/change user name?

  • Get several errors everytime I try to upgrade to windows 10 home

    Original title: Windows 7 Home Premium Hello I was wondering if anyone could help with my updates of windows 7 Home Premium, I was making several mistakes whenever I try to update for windows Home 10 try the software distribution method I tried conve