Using External .swf Linkage Audio

Because flash doesn't loop external mps file correctly, there
is always a pause in the loop. The work around is to load the AIFF,
or WAV, file into the .fla and let Flash compress the audio file,
then the loop works without the pause. The problem with this is
that when I have many music loops it takes a long time to publish
and test, so in AS 2 I would publish .swfs that compressed the raw
audio file and gave the audio file a linkage. Then I would load the
.swf into the main .swf and access the loaded .swfs linkage file.
The code looked like this:
_root.createEmptyMovieClip
("soundsMC",_root.soundsMC.getNextHighestDepth ());
instructionsContainer = _root.soundsMC.createEmptyMovieClip
("instructionsContainer", _root.soundsMC.getNextHighestDepth ());
instructions = new Sound (instructionsContainer);
instructions.attachSound ("instructions theme");
This worked perfectly. But this method does not work in AS3.
This is what I've tried in AS3:

by just moving code around I got it to work. I changed this
line:
var FishHoleOldMusicMCClass:Class =
libMedia.loaderInfo.applicationDomain.getDefinition("FishHoleOldMusicMC")
as Class;
To this:
var FishHoleOldMusicMCClass:Class =
loader.contentLoaderInfo.applicationDomain.getDefinition("FishHoleOldMusicMC")
as Class;
this is the code:
public function initView ():void {
loader = new Loader ();
targetStage.addChild (loader);
loader.contentLoaderInfo.addEventListener (Event.INIT,
loarderLoaded);
loader.load (new URLRequest("sound/fishhole_old.swf"));
private function loarderLoaded (event:Event):void {
trace ("loarderLoaded");
loader.contentLoaderInfo.removeEventListener (Event.INIT,
loarderLoaded);
var FishHoleOldMusicMCClass:Class =
loader.contentLoaderInfo.applicationDomain.getDefinition("FishHoleOldMusicMC")
as Class;
var music = new FishHoleOldMusicMCClass();
music.play(0, 1000);

Similar Messages

  • Recording video using external iSight and audio using wired input

    I would like to be able to record video using an external iSight camera I have from my old powerbook, but I don't want the audio to record through the internal microphone...I want it to record through a wired input coming off a mixer...is this possible?

    Welcome to iMovie Discussions.
    "..is this possible?.." ..I don't think so. By connecting an external FireWire iSight camera, iMovie expects both the vision and the sound to come in down the same FireWire cable.
    If you need to use a separate audio input, you may be able to do it by connecting a FireWire-capable camcorder (..a tape-based miniDV or HDV camcorder which uses a FireWire connection to attach to a Mac..) and then feeding your mixer's output to the camcorder's external-mic input ..at very low volume, of course, so that you don't wreck the camcorder's input.
    This entails using a camcorder which does have an external-mic (or line) input. That way, the picture from the camcorder will go straight into iMovie, as will the audio which is being fed into the camcorder ..thus both reaching iMovie via the camera's FireWire connection.

  • External .swf runtime linkage .pngs AS3

    Flash can compress .png files like Photoshop can compress
    .jpg files better than any other tool hands down.
    I have 77 .png files that are 1.8 .megs on my c: drive after
    I imported them and setting the file compression under the "File
    > Publish Settings" to 75% for jpg and published the .swf with
    all the .png on the stage the file size is 350K that's about 20% of
    the original file size of the .pngs downloaded file by file with 77
    separate request.
    I can create linkage in the shared .swf and test the movie
    with code in the shared .swf to add the movieclip holders for each
    .png to the stage but when I load the shared .swf into the main
    .swf Flash acts like it can't create the classes based on the
    linkage I setup or that the MovieClip linkage doesn't exist.
    I tried a test to have the shared .swf with all the .pngs and
    linked movieclips to add the assets to it's own stage and it works
    fine but that means a lot of my code and logic is included in the
    shared .swf that the designers need to add .pngs to. It's
    unfortunate AS3 sucks but I'm just about done with the project if I
    knew what a battle AS3 was going to be I would have stayed with AS2
    my next projet will be AS2 no question non at all. Anyway I setup
    "class" linkage identifier for each .png with a movieclip holder
    for each image. The 20% of the size for the pngs and one request
    vs. 77 separate request makes it worth the extra effort of
    importing the images, creating a holder movieclip with linkage but
    the main .swf that loads the shared .swf with all the assets and
    linkage can't see or create the assets like the shared .swf can
    when I test it.
    We need to have the main .swf get a handle of the linked .png
    assets and place them in the main .swf to load the assets to
    different parts of the main .swf. It's cute that the shared .swf
    can add the linked assets to it's own stage but not too useful.
    Also the way we deploy we cannot roll out a new release/build to
    update the .pngs but we can upload a new .swf to the asset server
    so the .pngs need to be in a separate .swf. I can get the shared
    MovieClip to add the linked assets to it's own stage when testing
    and when loading my problem is the main .swf that loads the shared
    .swf cannot create instances of the classes that are exported for
    runtime sharing using linkage.
    If it is possible I would like to know how the heck you get a
    handle on a linked asset in an externally loaded .swf. Preferably
    without creating my own prototyped insane class consisting of mega
    libraries of external .as files. Just a way to reference MovieClips
    holding pngs that have linkage and are setup for runtime sharing.
    It really shouldn't be this hard it's a simple task in AS2. I'm not
    looking for a coding competition or some wild class to do the job I
    want a few lines of code to create an instance of a class then
    reference to the linkage/MovieClip holding the .png to addChild it
    into a target movieclip.

    I solved it I'm loading 77 embedded assets in an external
    .swf that compresses 77 .png images without loosing quality it
    works great.

  • How to detect external SWF has stopped not using totalFrames

    Trying to find a way to detect when an externally loaded SWF has stopped. Using "totalFrames" like the example below doesn't work for what I'm trying to accomplish.
    I need something that simply listens and detects when the clip has stopped. Editing the external SWF is not an option. Thanks in advance for any insight.
    function onfrm( evnt: Event ): void
    if (newMC.currentFrame == newMC.totalFrames )
    newMC.removeEventListener( Event.ENTER_FRAME, onfrm);
    trace("End of banner");

    Just did a small test, and at least with loading a swf that has a timeline the totalFrames option works fine:
    var m:MovieClip;
    var a:Loader = new Loader();
    a.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
    a.load(new URLRequest("anim.swf"));
    function done(e:Event):void
      m = MovieClip(a.content);
      m.addEventListener(Event.ENTER_FRAME, chek);
      addChild(m);
    function chek(e:Event):void
      if(m.currentFrame == m.totalFrames){
      trace("done");
      m.removeEventListener(Event.ENTER_FRAME, chek);

  • External swf file not using URLRequest

    Good morning guys.
    You can load an external swf file not using URLRequest? Since embed html code is setted as <param value="never" name="allowscriptaccess"/>
    I have this problem and I need to load a swf skin
    thank you

    are you loading a swf (done during runtime) or importing one (done during authortime)?
    in either case, the allowscriptaccess parameter of the external swf (that your loading or importing) is irrelevant.  allowscriptaccess is assigned in the main (loading or importing) swf's embedding html page and is used to control html/js access of the main and loaded swfs.
    if you trust the swf you're loading, you can change allowscriptacess to always.  if you're importing a swf, none of its actionscript will execute anyway so it doesn't matter whether its trusted or not.

  • External SWF using stage width & height...

    Hi,
    I have an external .swf file (zoomify-esque) that I would like to use in my Flex app, but it's size attributes use the stage width and height.
    This basically means that the loaded swf file will load at 100% of the size of the stage. I can resize the loaded .swf using whatever Flex component I put it in, but that shrinks it rather than behaving like it would if I embedded it in an HTML page.
    I hope that makes sense. If anyone could help me out with this, I'd be very grateful!
    Thanks in advance,
      Alex.

    Thanks for your response Alex,
    The swf is from an external company that we pay for virtual slide serving software, and I am currently unaware of any other zooming tools that can efficiently view medical images averaging over 5 gigapixels in size. If you know of any, that'd be really useful, but correctly embedding the original swf is preferred.
      Alex.

  • Loading external swf using Loader.load() method is delayed with flash player 10.1 and next versions.

    I am trying to load an external swf file of size 300 kb using Loader.load() method and trying to access some objects in it and i am getting some delay in loading the external file with flash players 10.1 and next versions.
    The action script code used to load:
    var strUrl:String="toLoad.swf";
    var urlReq:URLRequest=new URLRequest(strUrl);
    var ldrLoader:Loader = new Loader();
    var ldrLoaderContext:LoaderContext = new LoaderContext();
    ldrLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, externakSwfLoaded);
    ldrLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorInLoadingSwf);
    ldrLoader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorInLoadingSwf);
    ldrLoaderContext.applicationDomain = ApplicationDomain.currentDomain;
    ldrLoader.load(urlReq, ldrLoaderContext);
    addChild(ldrLoader);
    System specifications:
    O.S. Windows XP sp2 (32 bit)
    Browser IE 6.0 (128 bit)
    Flash Player version WIN 10,2,152,32

    I think you are lost. This forum is for ROME. It sounds like you want one of the Flash or Flex forums...
    Good luck!
    Harbs

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

    I want to use semi-transparent mask on external swf for smooth transition. I'm using
    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 doesn't work... what am I doing wrong?

    well if your loadMovie is on the same timeline as the code you are setting as mask, then you dont need _root.
    And sorry, I forgot there was an issue with masking the main mc that loadMovie is loading into. So what I did was put clip inside another mc and called that mc "container" so then my code would look like :
    masker.cacheAsBitmap = true;
    container.cacheAsBitmap = true;
    container.setMask(masker);
    container.clip.loadMovie("movietoload.swf");
    download the two swfs attached, and open main.swf to see.

  • Loading External SWF using Absolute Path

    Hi,
    I am having trouble loading an external swf on a server using the absolute path. This external swf uses webcam streams and is loaded in the original swf file using the URL request code. I can load other swfs but just not that one. I have set the permission of the external swf to allow write/read/execute. Any help is apprieciated.
    P.S. I have also tried changing the location and name but still doesn't help.
    //Loads the augmented SWF into the main timeline.
    var request:URLRequest = new URLRequest("http://www.reminisce.me/files/jz_AR.swf");
    var loader:Loader = new Loader()
    loader.load(request);
    arHolder.addChild(loader);
    arHolder.x=300;
    arHolder.y=125;
    Thank you for your help in advance.
    -John

    I can´t get the linked swf to run in any browser, are you sure that it compiled right?

  • How to Load an external swf using loadmovie in AS3

    I need to create a button with script, on rollover load an external swf into movieclip in AS3.  This was able to create this in AS2, but I need to create this in AS3

    Thanks again Ned.
    Kenneth Russell
    graphic artist, Sr.
    Lockheed Martin - MS2
    2323 Eastern Blvd., Baltimore, MD 21220
    Phone 410.682.0554    Fax 410.682.0543
    From: Ned Murphy <[email protected]>
    Reply-To: [email protected]
    Date: Thu, 23 Jul 2009 19:08:25 -0600
    To: kenneth russell <[email protected]>
    Subject: How to Load an external swf using loadmovie in AS3
    In AS3 you use the Loader class to load external swf's and image files.  You
    should be able to find examples both in the Flash help files and these forums
    if you search.  If you aren't aware of how to code buttons in AS3, that can be
    found as well.  In AS3, just about any kind of interction involves the use of
    event listeners in combination event handler functions... in the case of a
    button rollover an example would be...
    btnName.addEventListener(MouseEvent.ROLL_OVER, overHandler);
    function overHandler(evt:MouseEvent):void {
         // your loading code or whatever
    >

  • Using external XML to load an swf

    Here's the deal - I have a main SWF with lots of loaders. Can
    a hyperlink in an external XML file load another external swf in
    the root flash doc? I have a list of links load in main SWF from an
    external XML file. From these links, I'd like to load other
    external SWFs in the main flash document. I can get the XML links
    to control my browser... can I get them to control what happens in
    my flash doc?
    Thanks!

    nothing in an xml file can load anything. but you can load a
    string that you use in your swf indicate which target file to
    load.

  • Using the firebox/ to record an external synth via audio outs and a USB Mic

    I have the following set up:
    firebox Firewired to the QuaD.
    ALL audio in and out is PRESONUS FIREBOX
    in GB prefs/sound/audio midi utility
    will i be able to record vocals with the USB samson
    and add
    an external synth coming in to channels 1/2 in the front of the Firebox 1/2 channels
    and ofcourse use GB as the recording studio and use this all together.
    the outs in the back of the Firebox go to a minidisc whose audio outs go to monitors so that i can record what i do in case genius strikes me fiddling around
    as we all do.
    so 1 Firebox, Firewire, Samson Mic ( USB ) GB 08 , minidisc, monitors
    with all drivers to PResonus together.
    i notice in audio midi i needed to change to device not mac to rid static
    Is this a plausible set up?
    can this work:
    The synth is taking up 1 real track ( i set monitor on and mono presonus track )
    the samson mic is taking up another real track
    can i hear record the synth and sing at the same time with them on both tracks
    Chris said use aggregate in the midi audio
    i do not understand how to do that and what that means?
    would someone be kind enough to explain this?
    please take it a step at a time.
    i essentially want everything working at the same time
    external synths/usb mics/Gband/external recording/monitors
    using the presonus firebox
    thanks for your time
    bless u all
    someone mentioned using aggregate in the audio midi utility.

    Funny you should say that. It used to work fine, then suddenly last night it stopped working in the line-in jack. It's crazy, I'm not sure what the deal is, still trying to figure out what happened.
    Cheers,
    Jose

  • Unable to unload external swf which is using runtime sharing

    Unable to unload external swf which is using runtime sharing of some symbols and classes.
    Due to this problem i am unable to load another swf or the same for the second time and getting errors at runtime.
    It works fine when the swf is opened in IE.
    Can anyone please help me in solving the issue.

    thank you
    i have tried to use   this.parent.Click_To_Close  but it gives compilation error
    i checked the tutorial about custom events i think its little complex for me now to understand the typeriter app.
    also i cheked the similer thread and tried to test that code myself..i found that the last block of main movie does not works and does not unload the loader2. however  all the trace are showing in the output windows that i added to check the code but last trace from the main movie is not showig...   
    trace("child removed from Main Movie") 
    so if this can work somehow i will use this method of event dispatch in my application that i am working...
    Thank you
    -----main movie ---------
    var loader1:Loader = new Loader();
    var loader2:Loader = new Loader();
    loader1.contentLoaderInfo.addEventListener(Event.COMPLETE, assignMovie1Listener);
    loader1.load(new URLRequest("movie_1.swf"));
    loader2.load(new URLRequest("movie_2.swf"));
    addChild(loader1);
    addChild(loader2);
    function assignMovie1Listener(evt:Event):void {
          MovieClip(evt.currentTarget.content).addEventListener("eventTriggered", removeLoader2);
                trace("listner is listning..")
    function removeLoader2(evt:Event):void {
          loader2.unloadAndStop();
          removeChild(loader2);
             loader2 = null;
                trace("child removed from Main Movie")
    //------------- movie_1.swf code:
    removeMovie2_btn.addEventListener(MouseEvent.CLICK , removeMovie2);
    function removeMovie2(event:MouseEvent):void
          dispatchEvent(new Event("eventTriggered"));
                trace("event triggered form Child Movie-1");
    as u can see when i click close button its triggering the trace from movie-1 but its not unloadign the movie2

  • Load and unload the external swf file using AS3(for window, IOS and android)

    For the external swf file loading, I use this code
    load2.addEventListener(MouseEvent.MOUSE_DOWN, newvid);
    function newvid(event:MouseEvent) {
              trace("you clicked me");
              var loadit = new Loader();
              addChild(loadit);
        var _lc:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
        loadit.load(new URLRequest("scene02.swf"), _lc);
    its working great but I don’t know how to unload the loaded swf files (looking: unload one by one and unload all)
    in AS2 we have
    on (release) {
              loadMovieNum("scene2.swf", 1);
              unloadMovieNum(2);
              unloadMovieNum(3);
    but i need in AS3

    Now I use this code and this time I got these compiler errors
    package {
                    import flash.display.SimpleButton;
                    import flash.display.MovieClip;
                    import flash.events.MouseEvent;
                    //import flash.display.URLRequest;
                    //import flash.display.Loader;
                    import flash.events.Event;
                    import flash.system.ApplicationDomain;
                    import flash.net.URLRequest;
                    import flash.system.LoaderContext;            
                                    public class load1 extends SimpleButton {
                                                    var loadit:Loader;              
                                                    public function load1() {
                                                                    this.addEventListener(MouseEvent.MOUSE_DOWN, loadfile);
                                                    private function loadfile(event:MouseEvent):void {
                                                                    trace("you clicked me");
                                                                    loadit = new Loader();
                                                                    this.parent.addChild(loadit);
                                                                    var _lc:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
                                                                    loadit.load(new URLRequest("s01.swf"), _lc);
                                                    private function unloadfile(event:MouseEvent):void {
                                                                    loadit.unloadAndStop();

  • Unload external SWF using event dispatch

    Hi i am working on a flash website where i have a main movie named as Navigation where i have all the navigation buttons and drop menus. i am using switch case method to load multiples external SWFs. so as user clicks on any of the navigation button...it loads the external SWF
    now i have a close_btn in the loaded SWF and i simply want the unload the external SWF when user clicks on the close_btn.
    I come to know that i can do this by event dispach but i am not sure what code to put in external swf  so when close_btn is clicked it can access the unloader function in main movie and unload the External SWF.
    Could you Please help, Thank you !
    this is my code
    //--------main swf---------------------
    import flash.display.Loader;
    import flash.display.Sprite;
    import flash.events.*;
    import flash.net.URLRequest;
              home_btn.addEventListener(MouseEvent.CLICK,Click_To_Close);
              ourstory_btn.addEventListener(MouseEvent.CLICK, clickHandler);
              facility_btn.addEventListener(MouseEvent.CLICK, clickHandler);
              customers_btn.addEventListener(MouseEvent.CLICK, clickHandler);
              sustainability_btn.addEventListener(MouseEvent.CLICK, clickHandler);
              contactus_btn.addEventListener(MouseEvent.CLICK, clickHandler);
    //  Dropdown Menu1 Buttons
              menu1.menu_mc1.organicinitiative_btn.addEventListener(MouseEvent .CLICK, clickHandler);
              menu1.menu_mc1.myhope_btn.addEventListener(MouseEvent.CLICK, clickHandler);
              menu1.menu_mc1.target2015_btn.addEventListener(MouseEvent.CLICK, clickHandler);
    //  Dropdown Menu2 Buttons
              menu2.menu_mc2.mens_btn.addEventListener(MouseEvent.CLICK, clickHandler);
              menu2.menu_mc2.womans_btn.addEventListener(MouseEvent.CLICK, clickHandler);
              menu2.menu_mc2.teans_btn.addEventListener(MouseEvent.CLICK, clickHandler);
              menu2.menu_mc2.babies_btn.addEventListener(MouseEvent.CLICK, clickHandler);
    var loader:Loader = new Loader();
    addChildAt(loader,0);
    function clickHandler(e:Event):void{
    switch(e.target.name){
        case "ourstory_btn": loader.load(new URLRequest("ourstory.swf")); break;
        case "facility_btn": loader.load(new URLRequest("facility.swf")); break;
              case "customers_btn": loader.load(new URLRequest("customers.swf")); break;
              case "sustainability_btn": loader.load(new URLRequest("sustainability.swf")); break;
              case "contactus_btn": loader.load(new URLRequest("contactus.swf")); break;
              case "organicinitiative_btn": loader.load(new URLRequest("organicinitiative.swf")); break;
              case "myhope_btn": loader.load(new URLRequest("myhope.swf")); break;
              case "target2015_btn": loader.load(new URLRequest("target2015.swf")); break;
              case "mens_btn": loader.load(new URLRequest("mens.swf")); break;
              case "womans_btn": loader.load(new URLRequest("womans.swf")); break;
              case "teans_btn": loader.load(new URLRequest("teens.swf")); break;
              case "babies_btn": loader.load(new URLRequest("babies.swf")); break;
    //-----------my unloader function in main swf --------------------
    function Click_To_Close(event:MouseEvent):void
                  if(loader != null) {
         loader.unloadAndStop();

    thank you
    i have tried to use   this.parent.Click_To_Close  but it gives compilation error
    i checked the tutorial about custom events i think its little complex for me now to understand the typeriter app.
    also i cheked the similer thread and tried to test that code myself..i found that the last block of main movie does not works and does not unload the loader2. however  all the trace are showing in the output windows that i added to check the code but last trace from the main movie is not showig...   
    trace("child removed from Main Movie") 
    so if this can work somehow i will use this method of event dispatch in my application that i am working...
    Thank you
    -----main movie ---------
    var loader1:Loader = new Loader();
    var loader2:Loader = new Loader();
    loader1.contentLoaderInfo.addEventListener(Event.COMPLETE, assignMovie1Listener);
    loader1.load(new URLRequest("movie_1.swf"));
    loader2.load(new URLRequest("movie_2.swf"));
    addChild(loader1);
    addChild(loader2);
    function assignMovie1Listener(evt:Event):void {
          MovieClip(evt.currentTarget.content).addEventListener("eventTriggered", removeLoader2);
                trace("listner is listning..")
    function removeLoader2(evt:Event):void {
          loader2.unloadAndStop();
          removeChild(loader2);
             loader2 = null;
                trace("child removed from Main Movie")
    //------------- movie_1.swf code:
    removeMovie2_btn.addEventListener(MouseEvent.CLICK , removeMovie2);
    function removeMovie2(event:MouseEvent):void
          dispatchEvent(new Event("eventTriggered"));
                trace("event triggered form Child Movie-1");
    as u can see when i click close button its triggering the trace from movie-1 but its not unloadign the movie2

Maybe you are looking for

  • Pop-up LOV - Internal Server Error

    I have a pop-up LOV with the query as below: select distinct a1 d, a1 r from temp where ((:P10111_X1 = 2 or :P10111 is null) or (:P10111_X1 = 1 and (col1 like :P10111_col1 or :P10111_col1 is null) and (col2 like :P10111_col2 or :P10111_col2 is null)

  • How do I turn off my phone with a broken lock button and screen doesn't work?

    my lock button broke a few months ago and I've been getting along fine without it due to assistive touch. Now, my screen won't work at all.. I can't slide it to open it, can't slide to power off .. only thing I can do is slide down the today thing at

  • The export file from a calc script - naming and date/time stamp

    Here is a simple calc script to export data. 2 questions: 1. Is there an easy way to add a date/time stamp on the name of the data file so that it does not overwrite the older ones every time? 2. I tried to specify the path so that it write to anothe

  • ORA-22275: invalid LOB locator specified on trigger

    I have a trigger which copies a blob on insert to one table to another. CREATE OR REPLACE TRIGGER SWZTPRO.TSWTMPI_BEFORE_INSERT BEFORE INSERT ON SWZTPRO.TO_TSWTMPI REFERENCING NEW AS NEW OLD AS OLD FOR EACH ROW DECLARE discriminator TO_TSWCRUL.BTC_DI

  • Is it possible to create a domain with 2 Foundation 2012 servers ?

    Hello, I need to install Windows 2012 servers, acting as DHCP servers, each one managing half of the IP range. There will be less than 5 users registered in this domain. My question is : can I use 2 Foundation versions (each one being a DC) ? Thanks