Swf loading problems

I'm trying to load a swf file into a main swf file.

It works very well.

The swf file I load is not made by me but bij of clients and is not guaranteed.

Because I'm addChild I what to resize it to the size I want.

This works very well for long the happy (animation) is everything inside the scene.

If there is something outside of the scene which should not be shown that it will be shown in any case.

I want, is to determine the stageWidth and stageHeight since the loaded swf file.

Thank you

Daniel Kuiper.

Try Loader. chargerand contentLoaderInfo.width. contentLoaderInfo.height

--

Kenneth Kawamoto

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

Tags: Adobe Animate

Similar Questions

  • Access to variables in Captivate swf load problem when run locally

    I am charge 3 Captivate SWF in a Flash drive custom. Here is pseudocode that arrives just at the point:

    var cp1_mc:MovieClip = this.createEmptyMovieClip ("cp1_mc", 1);
    cp1_mc.loadMovie ("captivate1.swf");

    [wait (cp1_mc.rdcmndGotoSlide! = undefined) through setInterval]

    cp1_mc.rdcmndGotoSlide IS

    var cp2_mc:MovieClip = this.createEmptyMovieClip ("cp2_mc", 2);
    cp2_mc.loadMovie ("captivate2.swf");

    [wait (cp2_mc.rdcmndGotoSlide! = undefined) through setInterval]

    cp2_mc.rdcmndGotoSlide REST UNDEFINED INDEFINITELY

    The thing is, this problem does not occur when you test the movie in Flash, or happens when the player.swf is run on a server. This happens when the player.swf plays locally in an html page.

    Can someone give me a clue as to what is happening? My best guess is that it has something to do with Flash Player Security, because it happens that locally in a browser, but I do not understand what is happening.

    It turns out that it was a Flash Player security issue and I had to put the security settings to "always trust" for my local directory.

  • SWF swf communication - swf loaded swf loading

    Hello
    I read the article by kglad SWF SWF communication when two SWF files uses actionscript 3.0 gratefully, but, probably because of my stubbornness, I have swf loaded at loading swf communication problems to work for me.

    Loading of swf (swf1.swf) as loaded swf (swf2.swf) by casting to a MovieClip loader.content worked well for me.

    I want the swf to call a function on the timeline of the swf file loading.  (Aside, I'm doubting it's possible, but I'm really very uneducated on this topic)

    I copied the article code in swf2.fla as below;

    Create a variable to refer to the main scenario for swf1

    var swf1Main_mc:MovieClip; This assumes that swf1 is a movieclip.

    Create your listener to ensure that loaded swf has been added to the display list and can get a

    the reference to the main timeline (which is always the main timeline of the SWF loading).

    this.addEventListener (Event.ADDED_TO_STAGE, initF);

    function initF(e:Event):void {}

    swf1Main_mc = MovieClip (this.root);

    }

    and add a simple button with an event listener for mouse to invoke a function (in swf2) for example

    function btnClicked(e:Event)

    {

    swf1Main_mc.showME ();

    }

    where showME() is a function in swf1.  for example

    function showME()

    {

    trace ("swf1 called swf2 showME");

    }

    All I get is a runtime error "TypeError: Error #1006: showME is not a function."  to swf2_fla::MainTimeline/btnClicked().

    I took out what little hair remains try different variations in the code then, in desperation, please someone can spot what I'm doing wrong or point me in the right direction?

    Thanks for your time,
    Bob

    A loaded swf file should not try to control its parent.  The child must only be send an event to the parent to take action.  In this way, the child is completely independent of the parent as well as to be able to publish on his own.  To load completion than the parent must assign an event listener to the child for this event, and the event handler function.

    Example:

    Add something to raise the event in the child:

    dispatchEvent (new Event ("eventTriggered")); (if problem dispatchEvent, see: http://www.kirupa.com/forum/showthread.php?p=1899603#post1899603)

    In your SWF to loading/parent, listen for the complete event on the Loader.contentLoaderInfo.  In the complete event handler, add a listener for the event on the loaded swf file.

    triggered when external swf loading event handler
    function loaderCompleteHandler(event:Event) {}
    MovieClip (event.currentTarget.content) .addEventListener ("eventTriggered", eventHandler);
    }

    function eventHandler(event:Event):void {}
    trace ("event sent in loaded swf");
    }

  • How to effectively remove a SWF loaded from the scene?

    I can't understand a correct coding to remove a SWF loded in the scene.

    Here is my set upwards.

    I have a layout that is segmented in section labeled. In the section titled 'products', I have a scheme consisting of images of products acting as buttons that bring a user in another section labeled "prdctsPopUps."

    In the "prdctsPopUps" section, I placed an instance of LoaderMax placed in a container of mc. Place LoaderMax in a container of mc automatically resolved a problem of clearing loaded SWFs from the stadium when I go back to the section "products".

    I specified the variable in the "products" section with the following set up:

    var sourceVar_ProductsPopUps:String;

    function onClickSumix1PopUp(event:MouseEvent):void {}

    sourceVar_ProductsPopUps = "prdcts_popups/sumix1 - popup_tl.swf ';

    gotoAndPlay ("prdctsPopUps");

    }

    So each button has its own "... swf ' URL and they all open very well and I can go back to the topic 'produced' without any problem.

    However inside the swf (that charge by LoaderMax which is placed in a mc) there are other buttons that lead a user to the section labeled "xyz". That works as well. It opens as he's supposed to be and without any previously loaded "... swf ' on the stage.

    In the section labeled "xyz", there is a limited set of buttons with the heading 'products' that must raise a user to the same game in the labeled 'prdctsPopUps' section and open a correspondent "... swf»

    However only the last opened "... swf" will appear in this section. Actually the only one that has been opened at the origin of the "prdctsPopUps" section, not who was supposed to be opened from the section "xyz".

    I do not understand why it would work a labeled section and not the other. I can't know which section what function/code should be placed.

    Here is the set up through a button in the section "xyz" supposed to bring a user to the same section of "prdctsPopUps" but to load another '... swf»

    var sourceVar_ProductsPopUps_fromXYZ:String;

    function onClick_floralytePopUp_fromXYZ(event:MouseEvent): void {}

    sourceVar_ProductsPopUps_fromXYZ = "prdcts_popups/floralyte - popup_tl.swf";

    gotoAndPlay ("prdctsPopUps");

    }

    Here's the code in place for the LoaderMax of the section "prdctsPopUps":

    var loaderProductPopUps:SWFLoader = new SWFLoader (sourceVar_ProductsPopUps,

    {

    estimatedBytes:5000,

    container: holderMovieClip,.

    onProgress:progressHandler,

    onComplete:completeHandler,

    centerRegistration:true,

    Alpha: 1,

    ScaleMode (ScaleMode): 'none',

    Width: 540,

    height: 730,.

    harvest: true,

    autoPlay:false

    });

    function progressHandler(event:LoaderEvent):void {}

    progressBarPopUp_mc.gradientbarPopUp_mc.scaleX = loaderProductPopUps.progress;

    }

    function completeHandler(event:LoaderEvent):void {}

    var loadedImage:ContentDisplay = event.target.content;

    TweenMax.to (progressBarPopUp_mc, 1.5, {alpha: 0, scaleX:0.25, scaleY: 0.25});

    }

    loaderProductPopUps.load ();

    Is there something that must be imported, or specific function must be specified in a specific titled section?

    in fact, I think that you will need to use something like:

    var loaderProductPopUps:SWFLoader;

    If ((loaderProductPopUps) {})

    {if (loaderProductPopUps.Content))}

    loaderProductPopUps.unload ();

    }

    }

    loaderProductPopUps = new SWFLoader (sourceVar_ProductsPopUps, //the value of sourceVar_ProductsPopUps allows to load several SWF files from the page produced.

    {

    estimatedBytes:5000,

    container: holderMov ieClip, / / convinient and easy to manage cases of placing the LoaderMax one mc empty (holderMovieClip)

    If this is not the case, will work as well. Then the container line: holderMovieClip, must be replaced by container: cela,.

    can be any size, cannot be resized as it distorts the content

    Manager onProgress:progress,

    onComplete: complete the Manager.

    centerRegistration: true,

    x:-260, y:-320, //no need for that is if used: centerRegistration:true,.

    Alpha: 1,

    ScaleMode (ScaleMode): 'none',

    scaleX:0, scaleY: 0,

    vAlign: "high."

    Width: 540,

    height: 730, / / scale proportionately but I need to cut the edges

    harvest: true,

    autoPlay:false

    });

    function progressHandler(event:LoaderEvent):void {}

    progressBarPopUp_mc.gradientbarPopUp_mc.scaleX = loaderProductPopUps.progress;

    }

    function completeHandler(event:LoaderEvent):void {}

    var loadedImage:ContentDisplay = event.target.content;

    TweenMax.to (loadedImage, 1.5, {alpha: 1, scaleX:1, scaleY: 1}); only need this line if the corresponding values are changed in Builder SWF loader

    TweenMax.to (progressBarPopUp_mc, 1.5, {alpha: 0, scaleX:0.25, scaleY: 0.25});

    }

    loaderProductPopUps.load ();

  • How can I create buttons of switch trigger MC in swf loaded

    Hello

    I am a newbie in ActionScript 3 and I am currently working on a project that has a (zoom) swf that zoom/pan a swf loaded a map (carte_web.swf). Everything was going well until I got more requests.  There are now two cards, same background, one with images and one with only one road. I try to add code to two buttons on a toolbar that is generated by the zoom.swf, to switch between the two cards, without losing its zoom/pan my cards are the two Flash-oriented object programming.  I spent 27 hours, trying to find a way, and I'm definitely at the end of my mind!

    I have a suggestion "to charge both your SWF in a sprite separately.» Then switching between sovereign wealth funds by removing and adding them to their parent sprite. The parent sprite is what you zoom. "I've tried everything!

    Any suggestions?

    If you want to keep the current state of each 'card', you will need to load each of these sovereign wealth funds in different sprites. In this way, you can just addChild and removeChild and save the State without having to reload the SWF file. Another way, you could actually do, would be to just reload in a sprite, and before you unload the SWF file, save all data of zoom/pan in an array or variable or something of that sort and just restore data to the card when it is reloaded. Don't know if I make sense here, but without details of your exact problem, it is difficult to say.

  • Swf loader help

    Hello all, I use Flash CS4 with AS3.


    I have a problem with the preloader site. When I simulate the load it is 'invisible' for awhile and then appear from loading of ~ 24-27% or perhaps ~ 55%
    To resolve this problem some people suggested to create a loader.swf (where you want to preload) and the site.swf: when the loader.swf have loaded the site.swf then it appear.


    Well, I tried this with the following code:

    var file:Loader=new Loader();
    var: path string.
    load.bar.scaleX = 0;

    run the preLoader (event: Event): void {}
    If (file.contentLoaderInfo.bytesTotal! = 0)
    {
    load.bar.scaleX = (file.contentLoaderInfo.bytesLoaded / file.contentLoaderInfo.bytesTotal);
    Load.txt_perc. Text = String (Math.round ((file.contentLoaderInfo.bytesLoaded/file.contentLoad erInfo.bytesTotal)*100))+"%";))
    }
    trace (file.contentLoaderInfo.bytesLoaded);
    }

    function stopLoader (event: Event): void {}
    trace ("Downloaded");
    file.removeEventListener (Event.ENTER_FRAME, preLoader);
    load.bar.scaleX = 0;
    Load.txt_perc. Text ="";
    }

    file.contentLoaderInfo.addEventListener (Event.COMPLETE, stopLoader);

    function loadMovie (): void {}
    load.bar.scaleX = 0;
    var swf:URLRequest = new URLRequest (path);
    leader. Load (SWF);
    file.addEventListener (Event.ENTER_FRAME, preLoader);
    stage.addChild (file);
    }

    function path1(e:Event):void {}
    path = "example.swf";
    loadMovie();
    }

    stage.addEventListener (Event.ENTER_FRAME, path1);


    But he returns this error:

    #2044 error: Unhandled IOErrorEvent:. Text = #2036 Error: incomplete loading.


    Someone told me that this error is due to the impossibility to find the URL of the swf file, but this is false since the swf file is finished.

    If I look at the load simulation I see multiple copies of the swf file are "loaded", but nobody is 100%.

    However, I said "responsible" because if I put a trace (file.contentLoaderInfo.bytesLoaded); I see a 0 permanent.


    Please help me I'm going crazy!

    where did,

    removeChild (file);

    come from?   which removes your swf loaded from the display list.  remove this line of code.

  • TypeError: Error #1009 (SWF loaded)

    I'm pulling my hair out on this one!

    I'm just starting a website (website full-Flash) using CS3 and AS3. I'm pretty much used to the new changes in AS3. I built a rough structure to make sure that the way I wanted to create the site would work (external swf loading, etc.). The tests worked.

    Now, I'm going to do real things, and I get this error as soon as an external SWF to load in:

    ------------------------------------------------------------------------------------------ -----------------------------------------
    TypeError: Error #1009: cannot access a property or method of a null object reference.
    at test_fla::MainTimeline/test_fla::frame2()
    ------------------------------------------------------------------------------------------ -----------------------------------------

    I tried this shrinkage, impossible to find the exact culprit (had to remove every shred of ActionScript, before starting to work again). So, I started to rebuild this film entirely - allowed out of the library and deleted all the layers. Did not work. Impossible to add a stop(); action in Frame 1.

    Then I started completely expenses File > New, rebuilt again. I tested after every single change. I finally built it up to the point where I first tested the original, and it worked. Then added some things more re-tested and I get the error again. Ahh, so I removed EXACTLY what I had just added. Re-tested. SAME ERROR - now it won't go away little matter what I delete!

    Crazier still is that I can always load in my other test SWF files and they have stock in them and they are set up exactly the same way - but they work...

    The entire site is new, so each SWF is CS3/AS3. I'm even not doing something crazy, so I'm pretty frustrated trying to build an AS3 all the site and I even do basic stuff...

    I can download/email the FLA files in question, if someone has the time to watch...

    Thank you
    Brandon

    It sounds ridiculous, but I think it had to do with the file names...

    I think that Flash CS3 has some problem with multiple file names using a hyphen, and start with the same word... I changed this:

    -test - container.swf
    -test - home.swf

    to do this:

    -test - container.swf
    -home.swf

    And rebuilt the home.swf from zero (new). And it seems to work now.

    Here, loads of test - container.swf the home.swf inside himself, I think he cannot know how to distinguish between the two because of the initial error in screaming "test_fla" rather than the name 'test-container_fla' or 'test-home_fla.

    Ugh.

  • Satellite L300 - boring loading problems

    Hello world.

    I've got my Satellite L300 nice for about 23 months now, and I absolutely love it.
    There is just one problem: my PC is not loading properly. There are always about a 1/50
    lucky, I have to play with the inputs and output for all 5-10 minutes each
    I plug it in time. I had this problem before (about two months ago) where I sent it
    Back to the store and they fixed. I was able to pick up there is still almost a month
    and everything worked properly again.

    It's really, really frustrating and I hope there is a solution simple sorta.
    Anyone who is familiar with this problem and to know what exactly is the problem?

    Thank you in advance.

    This kind of technical problems, there is no simple solution.
    If you have a serious issue with load problem, it is probably related to electronic power supply and it must be checked by authorized personnel only.

    Tell me but honestly: what can you fix these problems?

  • Satellite L30-10 x loading problems

    I have my laptop at the moment load problems and I don't know what part of the computer is the problem.
    I have the cable but it only works when the portable operating system on a certain position then so I try to move it, it stops charging...

    My cable is not in perfect condition, so that's what I think it is but I can't and won't replace the erroneous part...

    Only other things I can think of are the port where you plug the charger or the battery

    If the cable is damaged, you must stop using it and replace it as soon as possible. It could and cause damage to the laptop or home computer.

  • rinsing of the SWF loaded phase target mc?

    Hi, I'm using buttons to send the playhead to executives in which sovereign wealth funds are then loaded into an empty movieclip called "stage_target_mc"... .how I can then flush out the previously loaded swf then only a newly loaded swf displayed in "stage_target_mc"?  For example, after you click on the button 'about' swf 'about' load... then the "concepts" click the "concepts" swf loads - but the previously 'about' loaded swf plays again... I wish I could rinse the swf 'about' so only "concepts" are display, in this example.  Thank you!

    code associated with buttons that are used to send the playhead to frame "concepts" or "about":

    about_btn.addEventListener (MouseEvent.CLICK, displayAbout);

    function displayAbout(e:MouseEvent):void {}

    root.gotoAndStop ("about");

    }

    concepts_btn.addEventListener (MouseEvent.CLICK, displayConcepts);

    function displayConcepts(e:MouseEvent):void {}

    root.gotoAndStop ("concepts");

    }

    code on frame called "concepts":

    stage_target_loader. Load (new URLRequest("swfs/stages/concepts.swf"));

    MovieClip (root).stage_target_mc.addChild (stage_target_loader);

    code on frame called 'a way':

    stage_target_loader. Load (new URLRequest("swfs/stages/about.swf"));

    MovieClip (root).stage_target_mc.addChild (stage_target_loader);

    Before loading, try to use the method of the Loader class unloadAndStop() If you are using a version of Flash newr

  • How to get the content incorporate the swf file in Swf Loader on the run time

    How to get the content incorporate the swf file in Swf Loader on the run time

    [Bindable]

    [Embed(source="assets/index.swf")]

    private var SWFSRC: Class;

    < mx:SWFLoader id = "_swfloader" source = "{SWFSRC}" / >

    It might be Loader (DisplayObjectContainer (_swfLoader.content) .getChildAt (0)) content

  • How to control the video swf loaded in the loading component?

    I have an external swf file loaded into the loading component. The external swf loaded into the component loading stops at departure. I want to play by a button outside the loading component that is located in the main swf movie. CAN SOMEONE HELP ME CONTROL THE VIDEO SWF LOADED INTO THE COMPONENT OF LOADING EXTERNAL?

    You can target the SWF via the content property of the UILoader.  If the name of the instance the UILoader is ldr...

    MovieClip (ldr.content) .play ();

  • Controls the main scenario for swf loaded.

    Hello

    I use a textfield for debug information.

    I am loading a swf in the main timeline and I show the status in the textfield of debugging.

    function swfLoaderCompleteHandler(event:Event)

    {

    Debug.Text += "Swf loaded.";

    }

    This works.

    But,

    I am loading a png file in the loaded swf file. I'm showing the State of the png file that I showed the status of the swf file.

    function pngLoaderCompleteHandler(event:Event)

    {

    MovieClip (parent). Debug.Text += "Png loaded.";

    }

    I can't control the main swf from inside the loaded swf file. Same Stop or a function call does not work.

    I need to add something when I load the swf file, it's a MovieClip or something?

    Here is also a fla. http://flashfocus.nl/Forum/attachment.php?attachmentid=9885 & d = 1282509233

    You are welcome.

    Please mark this thread as answered, if you can.

  • (MX04) Pause a swf loaded with sound objects

    Hello

    I'm working on a presentation PowerPoint-esque where a user observes and listens to a swf loaded in the main sequence, click the button following (who unload the SWF, advances to the next section and load the next swf file), and the following watches. Make lather, rinse, repeat. Some articles are quite long, and I want to give the user the opportunity to take a break and play by click button.

    I know how to stop and start the MC container, but this does not prevent the sound object (and embedded CSM). I know how to make a break and start a sound object using the name of the instance of the object. Is there a way to pause the main story and keep the general enough so that any object sound stops when the user clicks on?

    Any help is most appreciated! MX04 and AS2.0.

    Thank you!

    you will need to list them all, or scroll through all the likely suspects with a loop (obj in mc).

  • HTMLLoader local content (SWF files) loading problems

    Hello guys,.

    I'm just to complete my request but I have a problem.

    I am developing a desktop air app.

    I use HTMLLoader to load SWF files local when you user tries to access a specific content on the application.

    I accomplished successfully, but the loaded SWF file also load other files (assets and xml with translations files) and it does not work.

    When a SWF file is loaded it will stop just on its own screen of loading (loading XML files).

    All this happens on my CustomNativeWindow:

    (my CustomNativeWindow 'overlays' the main application)

    public function CustomNativeWindow()
     {
             var nativeWindowInitOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
             nativeWindowInitOptions.systemChrome = NativeWindowSystemChrome.NONE;
             nativeWindowInitOptions.renderMode = NativeWindowRenderMode.DIRECT;
             nativeWindowInitOptions.resizable = false;
             nativeWindowInitOptions.maximizable = false;
             nativeWindowInitOptions.minimizable = false;
      
             super(nativeWindowInitOptions);
      
             alwaysInFront = true;
      
             this.activate();
    }
      
    public function setProperties(contentName:String, contentURL:String, posX:Number, posY:Number, stageWidth:Number, stageHeight:Number):void
    {
              this.stageHeight = stageHeight;
              this.stageWidth = stageWidth;
              this.contentURL = contentURL;
              this.contentName = contentName;
      
              this.x = posX;
              this.y = posY;
      
              this.width = stageWidth;
              this.height = stageHeight;
      
              this.title = contentName;
      
              this.addEventListener(Event.RESIZE, onWindowResize);
      
              SWFHTMLLoader();
    }
      
    private function SWFHTMLLoader():void
    {
    
              //REQUEST LOAD URL 
              var request:URLRequest = new URLRequest(contentURL);
      
              //HTML LOADER SWF
              htmlLoader  = new HTMLLoader();
              htmlLoader.width = stageWidth;
              htmlLoader.height = stageHeight;
              htmlLoader.addEventListener(Event.COMPLETE, onHtmlLoaderComplete);
              htmlLoader.load(request);
      
              stage.addChild(htmlLoader);
    }
      
    private function onHtmlLoaderComplete(e:Event):void 
    {
              trace("NATIVE WINDOW HTMLLoader complete");
      
              onWindowResize();
    }
      
    private function onWindowResize(e:Event = null):void 
    {
              if (htmlLoader)
              {
                        htmlLoader.width = stage.stageWidth;
                        htmlLoader.height = stage.stageHeight;
              }
    }
    
    

    Probably something related to security?

    How can I fix?

    Is a bit urgent... deadline is coming...

    Thank you!

    It is probably related to a path problem.

    What is contentURL?

    If it is anything other than swfname.swf, you have a problem.

Maybe you are looking for