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.

Tags: Adobe Animate

Similar Questions

  • External swf loading help please!

    Hi, Im trying to load an external swf on even an object in the main swf file, I'm using this code, but I get an error, please help if you can:

    bg.farm.addEventListener (MouseEvent.MOUSE_DOWN, farm_Press);

    var fl_Loader:Loader;

    function farm_Press(evt:MouseEvent):void

    {

    bg.farm.removeEventListener (MouseEvent.MOUSE_OVER, farm_Over);

    bg.farm.removeEventListener (MouseEvent.MOUSE_OUT, farm_OUT);

    bg.farm.removeEventListener (MouseEvent.MOUSE_DOWN, farm_Press);

    removeChild (bg);

    fl_Loader = new Loader();

    fl_Loader.load (new URLRequest ("farmSWF.swf"));

    bg.addChild (fl_Loader);

    fl_Loader.width = Capabilities.screenResolutionX;

    fl_Loader.height = Capabilities.screenResolutionY;

    }

    error-

    TypeError: Error #1009: cannot access a property or method of a null object reference.

    to Project2_fla::MainTimeline/frame1()

    THX pavel

    ferrisID.content, that's how you référenceriez the root of your loaded swf file

    also: you cannot close a swf file loaded, you simply to delete the instance of the stage charger

  • 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 ();

  • (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).

  • 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 ();

  • 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 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.

  • 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

  • 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.

  • HTML Loader Help

    I can't get my Flex program to work. I'm trying to load a pdf in HTML loader help file. I use Flash Builder and I get errors. The errors I get are:

    Access of undefined property htmlLoad

    Access of undefined property urlReq

    Calling a method perhaps undefined addChild.

    Can someone please tell me what I'm doing wrong?

    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                                xmlns:s="library://ns.adobe.com/flex/spark" 
                                xmlns:mx="library://ns.adobe.com/flex/halo">
    <fx:Script>
         <![CDATA[
              import flash.display.*;
              import flash.net.URLRequest;
              if(HTMLLoader.pdfCapability == HTMLPDFCapability.STATUS_OK) 
              {
                   var htmlLoad:HTMLLoader = new HTMLLoader();
                   var urlReq:URLRequest = new URLRequest("http://www.evilfishsolutions.com/test.pdf");
                        
              
                   
                   
                   htmlLoad.width = 800;
                   htmlLoad.Height = 800;
                   htmlLoad.load(urlReq); 
                   addChild(htmlLoad);
                   
                   
              }
              else 
              {
                   trace("PDF cannot be displayed. Error code:", HTMLLoader.pdfCapability);
              }
    
         ]]>
    </fx:Script>
    </s:WindowedApplication>
    

    Hello

    I think you should include your code in the function.

    Try this.

    import flash.display. *;
    import flash.net.URLRequest;
    public function addHTML (): void {}
    if(HTMLLoader.pdfCapability == HTMLPDFCapability.STATUS_OK)
    {
    var htmlLoad: HTMLLoader = new HTMLLoader();
    var urlReq:URLRequest = new URLRequest ("http://www.evilfishsolutions.com/test.pdf");
    htmlLoad.width = 800;
    htmlLoad.height = 800;
    htmlLoad.load (urlReq);
    addChild (htmlLoad);
    }
    on the other
    {
    trace ("PDF cannot be displayed. Error code: "(, HTMLLoader.pdfCapability);"
    }
    }

    Thank you

    Vikram

  • 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.

  • Color external swf loaded in AS3 urgent help!

    Hi I loaded swf to the external path by using the following command.

    var cviewer:Loader = new Loader();

    var curlRequest:URLRequest = new URLRequest("clipArts/"+evt.target.name);

    Therefore, the scenario.

    Let's say I have load Movie1.swf

    I have three video clips inside Movie1.swf called step0, step 1, step 2

    I need to change the color of step0, step 1 and step 2 of the parent flash file that loads Film1. The color of internal movie clips may be different from each other.

    I am able to change the color of the entire music video using

    var colorInfo:ColorTransform = cviewer.transform.colorTransform;

    colorInfo.color = evt.target.selectedColor;

    cviewer.transform.colorTransform = colorInfo;

    But not the individual. I even tried cviewer.step0.transform.colortransform and other things to see if it would work. But nothing has worked. Fast help would be much appreciated.

    Regards and thanks in advance.

    Try:

    var colorInfo:ColorTransform is MovieClip (cviewer.content).step0.transform.colorTransform;.

    colorInfo.color = evt.target.selectedColor;

    MovieClip (cviewer.content).step0.transform.colorTransform = colorInfo;

  • FLASH AS2 main swf loaded swf playback controls

    Hello

    I have two swf files. The main (main.swf) swf that loads another swf (external.swf).

    The current code in my main swf that loads external swf file is:

    Stop();

    this.createEmptyMovieClip ("holder", 1);

    holder.loadMovie ("content/swf/M01/disclaimer.swf");

    The loaded swf file must unload on a click event, then the main swf movie should resume playing.

    The code in the swf file is:

    on (release) {}

    _level0.gotoAndPlay ("hideMSG");

    _parent.unloadMovie("content/SWF/M01/disclaimer.swf",1);

    }

    The external swf file loads and unloads perfectly, but the film does not seem to take over.

    When I try to use _level0.play, it seems to reload and restart the file main.swf.

    Any help would be greatly appreciated.

    Laura

    No, there is no downtime in this context, there is indeed a play(); which is exactly what I want.

    I managed to get it using variables instead of work.

    Thank you

    Laura

  • AS3 pass variable values of external swf loaded in the parent swf format

    Hello

    I'm working on an e-Learning project that uses a main SWF (SWF1) and a second SWF (SWF2) with 2 quizzes in it. Published in the ATMOSPHERE for Desktop and Android, SWF1 and SWF2 are packed together in the Office of AIR or AIR APK exports.

    I use a charger in SWF1 to compose and execute SWF2. What I am having difficulties with, need help, is how to get 2 2 SWF2 quiz scores and load these values (each is a number) return SWF1. Once back in SWF1, they will be written to a string and then displayed in a text box using textbox.text.

    While I searched online and found examples to send variables from parent to child of the SWF file, so far not able to find an example of script understandable/useable AS3 to get variables from child to parent SWF.

    Any help appreciated.

    Best wishes

    The best way to communicate between parent and child SWFs is through events. Send an event to the child with the data to send and intercept the event to the parent level. This flow is common and very easy to handle

Maybe you are looking for

  • nightmare of backlit

    Began shooting a scene near a window in the morning, broke for lunch, then returned to PM to finish.  Did not notice at the time how sunny it was outside.  Long story short: the best shots are in PD and the window a terrible hot spot.  Someone at - i

  • Satellite A110-178 cannot run the Da Vini Code game

    My satellite A110-178 cannot launch the game "The Da Vini Code". following error occurs: Encountered exception! You want more information (will take several seconds to determine)? When I choose 'Yes', the following lines appear: (Slayer) Address of e

  • My messses up just mouse pad stops working

    Hello. I know how to turn on and off my mousepad, this isn't the problem, it gets little own spirit, I'll try to move and it just continues to enlarge the screen or go in another direction. The only thing that seems to fix it becomes a mouse and that

  • Buy games missing the market after PC rebuild?

    My PC could not restart eventullay after trying hard so I had to reformat and reinstall windows vista Home premium. Now to connect to Windows Marketplace my purchased games list is empty even though I had previously installed and played Bioshock 2 in

  • Node property of a control inside the cluster within a table

    I created a control that has a cluster to a Boolean, a string, and a digital.  Then, in my front, I created a table of these custom controls.  I wish I had access to the property of the controls inside the cluster in the table.  That is to say, I wan