Controlling multiple external swfs from main timeline

Hi, I've been trying to combine the features of two tutorials I found, one that deals with controlling external swf's from the main timeline and the other that explains how to load and unload multiple external swf's.  I'd like to be able to load and unload multiple external swf's, and control these swf's buttons from the main timeline. 
I asked this same question on the forum of the site where I found these tutorials, and receive only one reply saying that "it should'nt be hard to do." but they did not elaborate any further.  This left me think that I was missing something very obvious and I've spent too much time now trying to work what it is now.  I understand pretty much how both pieces of code work, but just can't work out how to combine them.
If someone could explain it to me, I'd much appreciate it.
Tutorial One code - controlling an external swf from the main timeline.
var ldr:Loader = new Loader();
var urlReq:URLRequest = new URLRequest("swfs/balls.swf");
ldr.load(urlReq);
function loadHandler (event:Event) {
var myClip:MovieClip = event.target.content;
addChild(myClip);
function myClipOver(event:MouseEvent):void {
myClip.myBlueBalls.stop();
function myClipOut(event:MouseEvent):void {
myClip.myBlueBalls.play();
// set listeners
myClip.addEventListener(MouseEvent.ROLL_OVER, myClipOver);
myClip.addEventListener(MouseEvent.ROLL_OUT, myClipOut);
// listener
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, loadHandler);
Tutorial Two code - loading and unloading multiple external swfs.
var Xpos:Number = 110;
var Ypos:Number = 180;
var swf:MovieClip;
var loader:Loader = new Loader();
var defaultSWF:URLRequest = new URLRequest("swfs/eyesClosed.swf");
loader.load(defaultSWF);
loader.x = Xpos;
loader.y = Ypos;
addChild(loader);
// Btns Universal function
function btnClick(event:MouseEvent):void {
removeChild(loader);
var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf");
loader.load(newSWFRequest);
loader.x = Xpos;
    loader.y = Ypos;
addChild(loader);
// Btn listeners
eyesClosed.addEventListener(MouseEvent.CLICK, btnClick);
stingray.addEventListener(MouseEvent.CLICK, btnClick);
demon.addEventListener(MouseEvent.CLICK, btnClick);
strongman.addEventListener(MouseEvent.CLICK, btnClick);

I will not be able to help you with whatever relaxatraja provided though it is purported by relaxatraja to be clearly explaining what I was explaining (???).
Your loadHandler function appears a bit confused.  For the code you show I don't see you assigning any event listeners for the events that will be dispatched in the loaded file.  As I showed earlier, your loadHandler function should be assigning a listener for the event that will be dispatched (modified slightly below). and if you have three different events being dispatched in the loaded file, then you'll do better to have three different listeners.  I show only one below for one of the events you dispatch...
function loadHandler (event:Event) {
  // assign a listener for the loaded file's goExit function's event
   MovieClip(event.currentTarget.content).addEventListener("close", event1Handler);
// I can't make sense of what you have here
    removeChild(myClip); // why ?? - it hasn't been added yet as far as I can see - error 2007?
    var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf"); // the event.target is the Loader
    ldr.load(newSWFRequest); // this will load over the file you just finished loading??
    ldr.x = Xpos;
    ldr.y = Ypos;
    addChild(myClip);  // why?? it has nothing in it
function event1Handler(e:Event):void {
    // do whatever is involved with what the "close" event is supposed to do
    trace("goExit function executed");
As far as what you have in the loaded file, you appear to be trying to pass the files names as if they were parameters.  The file naming should be done at the receiving side for the event handler function for the event listener.  While you could create a custom event that include parameters that you can pass, that's another level of coding that is better left for a future experience.
Study the following - understand it before you try to use it.
Below is a link to some files I made for another posting that demonstrates what I have been explaining.  The neurope file is the main file.  Publish the netherlands file so that you have an swf to load for it, and then run the neurope file.  The file that gets loaded (netherlands) only has a button in it that when clicked dispatches an event for which the main file (neurope) has assigned a listener.  The main file displays a message when the button gets clicked in the loaded file.
http://www.nedwebs.com/Flash/neurope.zip

Similar Messages

  • Controlling loaded swf from main timeline

    Hello,
    I'm working on loading external swf files for ios. I am able to load the swf files and set them to visible or invisible in different frames. I am having trouble controlling the loaded swf files from the main timeline. Specifically, I would like to have a button on the main timeline, that when clicked will move a loaded swf to frame 1.
    Here is a code that loads one swf file:
    var myLoader1:Loader;
    var loaderContext1:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
    if(myLoader1 == null)
              myLoader1 = new Loader();
              addChild(myLoader1);
    myLoader1.load(new URLRequest("folder/file1.swf"),loaderContext1);
    myLoader1.visible = true;
    backbutton.addEventListener(MouseEvent.MOUSE_DOWN, backbutton1);
    function backbutton1(myEvent:MouseEvent):void {???????????? myLoader1.gotoAndStop(1);}  (this line does not work)
    (Once I load file1.swf, within the file1.swf I click a forward button to move to different frames. My question is: how do I code the 'backbutton' on the main timeline so that it causes the loaded file1.swf to go to frame 1?)
    Thank you for your help.

    sure.
    if the movieclip on the loaded swf's main timeline has reference mc, you would use:
    MovieClip(myLoader.content).mc.gotoAndStop(1);
    p.s.  you might find the following helpful,  http://kb2.adobe.com/community/publishing/918/cpsid_91887.html

  • Control swf from main timeline

    i know i've done this before! i have a swf. 4 labels. a stop
    at frame 1. i embedd this into my main timeline. i have 4 butons in
    an MC in my main project, going to specific labels in my main
    timeline, where i have the following code, attempting to load the
    swf and jump to that label:
    this.container_shell.loadMovie("interact01.swf");
    interact_shellb.gotoAndStop("label1");
    its not working. the swf loads, but i can't jump to the
    label.
    any ideas? appologize for the basic question, i'm a designer,
    not a programmer!

    If you have a question to ask, you should start a new posting and include the code/info pertinent to your problem.  The one you are trying to catch a ride from is flawed and requires some questions to be answered.  Being that the posting is over 4 years old, it is unlikely the original poster is going to be answering any.

  • GotoAndPlay specific frame in external swf from main swf

    I have a main swf that loads 2 external swfs.
    I click on button to see content of external swf #1 and see stuff. I do something that causes external swf to show other stuff (i.e. not at beginning state)
    In the main swf I click on button to see content of external swf #2. External swf #1 content is made invisible and I see content of external swf stuff.
    NOW, if I click on button to take me back to see external swf #1, I see it's content in current state. I want to force it to start over again at frame #1 which will reset content.
    However, no matter what I try, I can't seem to control which frame to go to in external swf using gotoAndplay.
    Here is code in frame #1 of main swf to load external swfs:
    //load academic movie
    var swfLoader1:Loader = new Loader();
    container1.addChild(swfLoader1);
    var url1:URLRequest = new URLRequest("academic.swf");
    swfLoader1.load(url1);
    //load wisdom movie
    var swfLoader3:Loader = new Loader();
    container3.addChild(swfLoader3);
    var url3:URLRequest = new URLRequest("wisdom.swf");
    swfLoader3.load(url3);
    Here is code in frame 2 of main swf that checks button to see where to go in external swf:
    //academic button clicked
    function academicClick(event:MouseEvent){
       container3.alpha = 0;
       container3.visible = false;
       container1.visible = true;
       container1.gotoAndPlay(1); //this is where I am trying to force it to start at frame 1
       container1.alpha = 1;
    I don't want to reload the external movie to force it to start over.
    Any help would be much appreciated.

    You can easily control this by making the external swf to load with your movieclip, The below is the code snippet that clear on accessing the specific frame on external swf.
    //Loading clips content
    var ldr:Loader;
    var mcExt:MovieClip;
    //Loading
    loadswf("external.swf");
    function loadswf(tmp:String):void{
        unloadSwf();
        ldr= new Loader();
        ldr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressListener);
        ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoaded);
        ldr.load(new URLRequest(tmp));
        function progressListener (e:ProgressEvent):void{
            ploader.visible=true;
        function swfLoaded(e:Event):void {
            mcExt = e.target.content as MovieClip;
            ldr.contentLoaderInfo.removeEventListener(Event.COMPLETE, swfLoaded);
            mcExt.addEventListener(Event.ENTER_FRAME,onEnterfn);
            ploader.visible=false;
            addChild(mcExt);
    //UnLoading
    function unloadSwf():void{
        if (ldr!=null){
            ldr.unloadAndStop();
            removeChild(mcExt);
            mcExt=null;
    //Intervals (The part you work on the specific frame within the external swf
    function onEnterfn(e:Event):void{
        var num:int=mcExt.currentFrame;
        if (num==1) mcExt.play();
        if (num==9) {
                mcExt.skipmc.addEventListener(MouseEvent.CLICK,skipfn);
                function skipfn(e:MouseEvent):void{
                    mcExt.stop();
                    mcExt.removeEventListener(Event.ENTER_FRAME,onEnterfn);
                    gotoAndStop("help");
        if (num==mcExt.totalFrames){
            mcExt.removeEventListener(Event.ENTER_FRAME,onEnterfn);
            gotoAndStop("help");
    hope it solve

  • How to load and unload Multiple External SWF

    hello there,
    i need help to figuring out how to load and also unload(removing) multiple external SWF.
    so here is what i;m trying to do,
    i want to load multiple external SWF and play it on my main SWF now i hove no problem with just loading multiple SWF and placing it in the display list .The problem came up when i tried removing those loaded SWF from the display list ,The problem exist because i have no way to refer to what i have loaded and placed on the display list,
    i used a single loader instance to load all that external swf,
    i do know that we have to remove all the event listener related to the external SWF that we want to remove and for this purpose i have crated a function called destroy which the main objective for this function is to remove all event listener inside the swf and also isolating all variable so it would be eligible for garbage collecting, here is what the code look like:
    // Create this in every object you use
    public function destroy():void
         // Remove event listeners
         // Remove anything in the display list
         // Clear the references to other objects, so it gets totally isolated
    sorry it just a kind of pseudocode cause this function will customize with it's own property i did this just for the purpose of simplicity and easy understanding..,
    so now back to main problem how should i solve this problem??
    i tried used an arraf to save all the loaded swf
         the array is just used to save the what the loader is loading but the adding to display method is using
    movieClipActAsContainer.addChild(e.target.content); //the event is from the Event.COMPLETE
    but i have a hard time using that arrya back and matching it to the one i got from the display list.
    please do help me,
    any suggestion would be greatly appreciated,
    and if can pleas show me a source code or pseudocode of what you're suggesting to me cause my english is not so fluent yet,
    thanks before.

    Hey EI,
    I had done this kind of project recently and for loading and unloading different swfs. I had used loaders specific to that filename and for removing I had used a single movieclip instance name and on clicking that specific loader request name that needs to be removed will be requested from the specific function. As mentioned below
    Loading SWF:
    ===============================
    swfLoaderIndia.load(swfRequestIndia);//This will load the request
    If you are inside a movieclip while requesting use below code
    MovieClip(this.root).addChild(swfLoaderIndia);//This will load swf on stage
    or else
    Stage.addChild(swfLoaderIndia);
    Unloading SWF
    =====================================
    If you are inside a movieclip while requesting use below code
    MovieClip(this.root).removeChild(swfLoaderIndia);//This will unload swf on stage
    or else
    Stage.removeChild(swfLoaderIndia);
    Above code will be in specific function which will be requested when the loading and unloading is required.
    I hope this helps you in your project.
    With Regards,
    Sagar S. Ranpise

  • Controlling movieclip from main timeline & Child

    Hi,
    This code is currently contained within my "mc_1" movieclip. I want to be able to have this code on my main timeline, however no matter what I try I constantly get errors, multiple different versions. I've tried adding mc_1 infront of everything, but that just gives an output error about a Sprite.
    Also, I'm currently using visible to control whether the back image to the textbox should show - What I'd really like to do is control it using a child, but they're movieclips not buttons, so when I try to addChild within the function it errors saying I'm trying to control a movieclip within a simplebutton function.
    import flash.events.MouseEvent;
    stop();
    mc_textbox.visible = false;
    for(var i:uint=1; i<8; i++){
        this["line"+String(i)].addEventListener(MouseEvent.ROLL_OVER, line_in, false, 0, true);
        this["line"+String(i)].addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
    function line_in(e:MouseEvent):void // Defineing the function as line_in
        var lineTarget:SimpleButton = SimpleButton(e.currentTarget); // The variable is lineTarget
        switch(lineTarget) // Each case should swap the lineTarget
            case line1: // line 1 is the first button
            line_output.text = "1"; // This text should display
            mc_textbox.visible = true; // The textbox should display
            break; // If this is not the case, break and check next
            case line2:
            line_output.text = "2";
            mc_textbox.visible = true;
            break;
            case line3:
            line_output.text = "3";
            mc_textbox.visible = true;
            break;
            case line4:
            line_output.text = "4";
            mc_textbox.visible = true;
            break;
    /* This case has much more text than the rest, as such the textbox is enlarged for this case only
    and changed in position. The line_output dynamic text field is also moved on the Y axis for this.
    This is reset to default using the line_out function.
            case line5:
            line_output.text = "55";
            line_output.y = 427.65;
            mc_textbox.visible = true;
            mc_textbox.height = 100;
            mc_textbox.y = 417;
            break;
            case line6:
            line_output.text = "6";
            mc_textbox.visible = true;
            break;
            case line7:
            line_output.text = "7";
            mc_textbox.visible = true;
            break;
            default: // If none of the cases are true, this should display
            line_output.text = ""; // line_output should be blank
            mc_textbox.visible = false; // mc_textbox should be invisible by default
    function line_out(e:MouseEvent):void
            line_output.text = "";
            line_output.y = 474.65;
            mc_textbox.visible = false;
            mc_textbox.height = 61.95;
            mc_textbox.y = 454;

    I've resolved the timeline issue. Now my only issue is the Child not working.
    What I'm trying to do:
    addChild(mc_1.mc_textbox) to appear upon rollover of a button. On rolloff, for the child to be removed.
    Add mc_textbox inside mc_1 on rollover, at a specific XY and height. On rolloff, for the child to be removed.
    I have also been told that I should not have a dynamic textbox on the scene and should call that in using AS3 - If you have time, could you inform me how this would be done?
    Thanks alot for the help,
    ERROR:
    TypeError: Error #2007: Parameter child must be non-null.
        at flash.display::DisplayObjectContainer/addChild()
        at Main_new_fla::MainTimeline/line_in()
    TypeError: Error #2007: Parameter child must be non-null.
        at flash.display::DisplayObjectContainer/removeChild()
        at Main_new_fla::MainTimeline/line_out()
    import flash.events.MouseEvent;
    stop();
    for(var i:uint=1; i<8; i++){
        this.mc_1["line"+String(i)].addEventListener(MouseEvent.ROLL_OVER, line_in, false, 0, true);
        this.mc_1["line"+String(i)].addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
    function line_in(e:MouseEvent):void // Defineing the function as line_in
        var lineTarget:SimpleButton = SimpleButton(e.currentTarget); // The variable is lineTarget
        switch(lineTarget) // Each case should swap the lineTarget
            case mc_1.line1: // line 1 is the first button
            mc_1.line_output.text = "1"; // This text should display
            addChild(mc_1.mc_textbox); // The textbox should display
            break; // If this is not the case, break and check next
            case mc_1.line2:
            mc_1.line_output.text = "2";
            addChild(mc_1.mc_textbox);
            break;
            case mc_1.line3:
            mc_1.line_output.text = "3";
            addChild(mc_1.mc_textbox);
            break;
            case mc_1.line4:
            mc_1.line_output.text = "4";
            addChild(mc_1.mc_textbox);
            break;
    /* This case has much more text than the rest, as such the textbox is enlarged for this case only
    and changed in position. The line_output dynamic text field is also moved on the Y axis for this.
    This is reset to default using the line_out function.
            case mc_1.line5:
            mc_1.line_output.text = "55";
            mc_1.line_output.y = 427.65;
            addChild(mc_1.mc_textbox);
            mc_1.mc_textbox.height = 100;
            mc_1.mc_textbox.y = 417;
            break;
            case mc_1.line6:
            mc_1.line_output.text = "6";
            addChild(mc_1.mc_textbox);
            break;
            case mc_1.line7:
            mc_1.line_output.text = "7";
            addChild(mc_1.mc_textbox);
            break;
            default: // If none of the cases are true, this should display
            mc_1.line_output.text = ""; // line_output should be blank
            addChild(mc_1.mc_textbox); // mc_textbox should be invisible by default
    // Removes any text that has been displayed from the Dynamic text box, also resetting the sizes to default.
    function line_out(e:MouseEvent):void
            mc_1.line_output.text = "";
            mc_1.line_output.y = 474.65;
            removeChild(mc_1.mc_textbox)
            mc_1.mc_textbox.height = 61.95;
            mc_1.mc_textbox.y = 454;

  • Flash 8 xml rotator.swf and main timeline frame looping

    Hi Y'all -
    I have a purchased swf file that randomly rotates images (90
    or them) located in an external xml file. It works fine in it's own
    swf file.
    The author suggested dragging the movie clip to the library
    and to the stage. I did that in frame one, on its own layer of my
    main swf file, followed by empty keyframes for all other frames in
    the main swf. That works too, only showing the rotating logos in
    frame one.
    However, the stop(); actions on each of the other frames are
    ignored, so that going to frame two on the main timeline starts
    with the proper content and then continues on to the next frame and
    the next. Without the rotator, buttons control the action and I
    have no problem.
    This link shows the problem -
    http://uniconexed.org/bigflash/unicon-05-17-08-newlook.swf
    I've tried attaching the swf file and unloading it, using
    "create empty movie clip" (my current attempt outlined in the
    code), and about a half dozen other ways to no avail.
    I think I need to kill "play movie" when someone leaves frame
    one (or enters any other frame) even though not all of the 90
    images have displayed. It could be some depth issue, or lock root,
    I dunno.
    To restate, one of two things happen -
    1) the scene continues to display the files randomly over top
    of the content in the other frames (wrong) but the navigation
    buttons work (correct)
    or
    2) the random images do not display in the other frames
    (correct) but the navigation stops at each frame do not work
    (wrong) - the swf file scrolls through each of the frames, ignoring
    the stop(); at the top of each frame.
    Any help that leads to success would be greatly appreciated.
    Dan

    Hi there,
    Try using...
    unloadClip(myContent);
    instead of
    unloadMovie(myContent);
    unloadClip is the proper method to use when removing content
    created with the MovieClipLoader class

  • Loading an external SWF from an external SWF

    Hello,
    I'm somewhat caught between a rock and a hard spot on a flash
    site project. Here is the situation:
    I have created a parent movie (which loads all external SWFs
    inside of it) that has the menu navigation built into it. However,
    my client wants me to place some more links inside of the external
    SWFs that lead to other pages (external SWFs) of the site. Is this
    at all possible? I was hoping there is a way to tell a button in an
    external SWF to make the parent movie switch between external SWFs.
    Any and ALL help is very much appreciated. Thank you.
    Another question: does this involve using the _parent script?
    Elijah

    Hello,
    Thank you for replying. Here is exactly what I'm needing to
    do:
    We will call the parent file "index.swf". Inside "index.swf"
    I have a "holder" for external swf files to load into when I call
    on them from the main menu buttons on "index.swf". When a customer
    comes to the site, the "index.swf" file initially loads
    "welcome.swf". Inside of "welcome.swf", I have some images that I
    want to make into links to other external swf files.
    My problem is when someone clicks on one of those pictures I
    want the "index.swf" file to open up the corresponding external swf
    file in its "holder", where "welcome.swf" currently resides. Also,
    all of these swf files ("index.swf" included) have stand-alone FLA
    files, none are attached to one another. I have never worked with
    "levels" before, would that be necessary in this case? I have
    attached the code for the external swf loader.
    I hope that gives you a better idea of what I'm trying to
    accomplish.
    Thanks again.
    Elijah
    CODE:

  • Control an external SWF

    Ok say I have a big comeplete Flash website.
    The website is composed of:
    -The main stage
    -Movie Clip that loads external swfs 1 (let's call this "A")
    -Movie Clip that loads external swfs 2 (let's call this "Z")
    So say A is a movie clip that loads a menu (external swf).
    Can I control Z (like changing frames and so on), by clicking
    buttons on A (since it's a menu)?
    I hope I was clear.
    So it is possible, how would the paths be written?

    button1.onRelease = function() {
    _root.Z.gotoAndStop ...
    heart ways wrote:
    > Ok say I have a big comeplete Flash website.
    >
    > The website is composed of:
    > -The main stage
    > -Movie Clip that loads external swfs 1 (let's call this
    "A")
    > -Movie Clip that loads external swfs 2 (let's call this
    "Z")
    >
    > So say A is a movie clip that loads a menu (external
    swf). Can I control Z
    > (like changing frames and so on), by clicking buttons on
    A (since it's a menu)?
    >
    > I hope I was clear.
    >
    > So it is possible, how would the paths be written?
    >

  • Loading external .swf from an array in  array order

    I was wondering if someone can help me out.  The code below demonstrates pulling in multiple .swf from an array and plays each one randomally when the "main .swf re-publishes each time.  I cant figure out how to play each .swf in the order that specifies in the array.
    example:  I want the main .swf to play 'clip0','clip1','clip2' in that specific order not random.
    Can someone assist me.
    stop();
    var movieArray:Array = ['clip0','clip1','clip2'];
    var loader:Loader = new Loader();
    var index:int = movieArray.length * Math.random();
    var url:String = movieArray[index] + '.swf';
    trace("Attempting to load", url);
    loader.load(new URLRequest(url));
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderComplete);
    loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loaderIOError);
    addChild(loader);
    function loaderComplete(e:Event):void {
        trace("Successfully loaded", url);
    function loaderIOError(e:IOErrorEvent):void {
        trace("Failed to load", url);

    so replace:
    var index:int = movieArray.length * Math.random();
    with this:
    var index:int = 0;

  • Unload external swf from flv component

    Please help.
    Is it possible to add action script to the flv player
    componet buttons?
    I am trying to unload an external swf file (voice over) if
    the viewer chooses to play one of the many videos in the
    presentation. Currently I am using an invisible button over the flv
    component play button which unloads the swf. This works but would
    rather assign the action directly to the flv play button on press.
    Any suggestions? Thank you

    I've created a empty movieclip at x : 0, y : 0 instanced as "container"
    i've got working like this,
    but now i 'm trying to call a function in root, directly from child.
    luca.swf (back button_
    box.bt_voltar.addEventListener(MouseEvent.CLICK,onClosed);
    function onClosed(e:MouseEvent):void {
              if(this.parent) {
                         if(this.parent is Loader && this.parent.parent)
                          this.parent.parent.removeChild(this.parent);
                         else
                          this.parent.removeChild(this);
              var p:MovieClip = this.parent.parent as MovieClip;
              p.traceEntrada();
    and main.swf
    function lucaHandler(e:MouseEvent):void
                        limpaHome();
                        bt_luca.visible = false;
                        bt_conheca.visible = false;
                        bt_jogo.visible = false;
                                    var ldrLuca:Loader=new Loader();
                                  ldrLuca.load(new URLRequest("luca.swf"));
                                  ldrLuca.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
                                  addChild(ldrLuca);
                        function onCompleteHandler(loadEvent:Event):void{
                                  container.addChild(loadEvent.currentTarget.content);
    function traceEntrada():void{
                   trace("called from B.swf");
    Now, as you can see, how can i call a function in parent from the loaded swf.
    how can i call this trace function from the external loaded swf?
        var p:MovieClip = this.parent.parent as MovieClip;
         p.traceEntrada();
    ps, im not using classes

  • Loading external swf, from a previously loaded external swf.

    I'm trying to figure out if its possible to have a page that
    loads an external swf (easy, know how to do that), but then, from
    clicking on a button thats inside that loaded swf, load a different
    external swf in its place. Any ideas?

    I've tried a few things... including what you suggested, but
    either I'm still not putting the code in the right spot... or the
    code isn't working like it should. I have a zipped folder of the
    project files on my server if you could download and take a look. I
    have a readme file in there too explaining exactly what I want
    accomplished.
    http://www.deltawavefilms.net/little_example.zip

  • Importing fl.controls causes external .swfs to crash

    Hello,
    I've discovered that if I use fl.controls.* classes in my AS3
    code, and then load an external .SWF that uses something like
    fl.controls.combobox, I will get a crash when clicking on the
    combobox.
    The crash is as follows:
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at fl.containers::BaseScrollPane/drawBackground()
    at fl.controls::List/draw()
    at
    fl.core::UIComponent/drawNow()[fl\core\UIComponent.as:1198]
    at fl.controls::List/scrollToIndex()
    at fl.controls::SelectableList/scrollToSelected()
    at fl.controls::ComboBox/open()
    at fl.controls::ComboBox/onToggleListVisibility()
    I am not creating new fl.controls.* objects in my AS3 code, I
    am merely trying to type them correctly so I can reference them in
    code. For example, with the following code, the app crashes:
    public function getButton(buttonNum:int):Button
    return mDialog["button" + buttonNum];
    If I change that code to return Object instead of Button, the
    code works fine.
    Any thoughts???

    thanks….maybe it isn't a actual kernel panic….I was not sure what to call it….the old kernel panic were in UNIX code…this is a SYSTEM NEEDS TO BE REBOOTED
    and it is only with LIGHTROOM
    no other app causes this.
    I can't find the copy paste of the actual SYSTEM REPORT
    I will try to repeat it…..and copy it for everyone to see today….
    thanks
    I greatly appreciate your help
    jsm

  • Accessing class var from main timeline

    Hi all! Well I've been working on this for a couple of days
    now and just can't seem to get it to work right...... I'm still
    getting my feet wet with as3 and like it more and more everytime I
    use it.... almost.
    Anyways, here's where I'm running into trouble.
    Here's a dumbed down version of my project with all the other
    usless drivel excluded. Basically what I'm trying to do is declare
    a var and give it a value in my class. Then I want to be able to
    display that value on the stage and use it in the main timeline.
    Seems simple enough....
    I need to be able to pass the var from the class to the main
    timeline for use.... Any help on this would be GREATLY appreciated.
    Thanks.

    kglad, worked like a charm in my short test file... however
    in my real world flash file the class takes a short time to
    actually compute the value of the variable. If I fire the trace
    from the main timeline it will display NaN b/c at the moment it
    fires the value of the var doesn't exist b/c it has yet to be
    calculated......
    I don't really know the best way to delay this... would the
    best way be to somehow add an event listener to listen to the var
    to see when it is assigned a value?.... I'm open to suggestions.
    btw, good catch on the assignment of a string value!!
    Thanks!

  • Play exit animations on multiple external SWF's?

    Hi,
    Here is what I would like to do: I have some buttons, then 2
    movie clips named container and container2. When I click on a
    button, an external SWF is loaded into container. I have it working
    so that when another button is clicked, it plays the exit animation
    of the current SWF, then loads the new one. Here is the code that I
    used for that:
    on a button:
    Code:
    on (release) {
    if (_root.currMovie == undefined) {
    _root.currMovie = "who";
    container.loadMovie("who.swf");
    } else if (_root.currMovie != "who") {
    if (container._currentframe >= container.midframe) {
    _root.currMovie = "who";
    container.play();
    In who.swf frame 1:
    Code:
    midframe = 114;
    In who.swf last frame:
    Code:
    _root.currMovie = undefined;
    stop();
    Frame 114 is where the exit animation starts.
    What I would like to do, is have a button in who.swf, that
    will load another external swf into container2, while leaving
    who.swf in place. Then, when one of the main buttons is clicked, I
    would like it to play the exit animation of the swf that is
    currently in container2, then play the exit animation of the swf
    that is currently in container, then load the new swf into
    container. Can someone please help me out with the code for that?
    Thanks!

    the thing is that i had to keep a reference to my Loader.
    if you dont keep a reference to the Loader who is processing the loadBytes(), the Garbage Collector could close the Loader, wich causes the loader to unload.
    i tried this with a test, i load 1 swf binary with an urlloader, and in the complete-event i create 100 loaders wich do a loadBytes on the loaded bytes.
    the FlashBuilder console traces 100x [SWF] <path> 1000 bytes after decompression, and sometimes i get a whole bunch of [Unload SWF]
    this is because i dont keep any reference to the Loader. if i would keep a reference to the loader stored in an array, i dont get the unload. when the loader is done, you can store the content in a variable, and remove the loader, but as long as its loading, you should keep a reference to the loader.
    Hope this helps others.
    p.s.  i keep seeing [SWF] Main.swf instead of [SWF] <loaded swf file> is because i load the swf with an URLLoader (wich gives no trace), but when i do a loadBytes, it doesnt know its path anymore, so you get the root-swf, Main.swf in this case.

Maybe you are looking for

  • HT1349 Can I upgrade my iOS3.1.1 to iOS4 or iOS 5

    Can I upgrade my iOS3.1.1 to iOS4 or iOS 5?

  • Recomend a lightweight X file manager?

    As much as I like using the terminal for much of my administrative activities, I would like a lightweight norton commander like file manager for x.  It would be nice if an arch package existed for it as well, although this is not a requirement.

  • How do I "Save As" a file?

    Scenario: I used Barcode Scanner to scan the barcode for some software (an Android .apk) file. It offered me: - Email to someone - SMS to someone - Open in browser So I did the third. It then asked me: "Native browser or Firefox?". The native browser

  • Attach printer using ethernet on airport extreme

    How do I connect a printer via ethernet to airport extreme?

  • Display Out Questions

    So I really can't figure out what is going on. I have a mini display to hdmi chord which will put my computer screen onto my tv. Also I have a mini display to vga adapter with a vga chord to plug into that and then plug into the back of my tv. the hd