Cannot target the main stage of dynamically loaded swf...

A part of the Flash application. I'm working on right now is the following-

Main stage load an external swf using the following function:

function loadAsset(evt:String):void{
 var assetName:String = evt;
 if (assetName != null){
  var assetLdr:Loader = new Loader();  
  var assetURL:String = assetName;  
  var assetURLReq:URLRequest = new URLRequest(assetURL);  
  assetLdr.load(assetURLReq);  
  assetLdr.contentLoaderInfo.addEventListener( Event.INIT , loaded)  
  assetLdr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, displayAssetLoaderProgress);   
  function loaded(event:Event):void {  
   var targetLoader:Loader = Loader(event.target.loader);  
   assetWindow.addChild(targetLoader);
  }
 }
}

The external swf file loaded, load another external swf to itself using the following function:

function loadQuiz(evt:String):void{    
 var quizName:String = evt; 
 if (quizName != null){ 
  var quizLdr:Loader = new Loader(); 
  var quizURL:String = quizName; 
  var quizURLReq:URLRequest = new URLRequest(quizURL); 
  quizLdr.load(quizURLReq); 
  quizLdr.contentLoaderInfo.addEventListener( Event.INIT , loaded)        
  quizLdr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, displayQuizLoaderProgress);  
  function loaded(event:Event):void { 
   var targetLoader:Loader = Loader(event.target.loader); 
   quizWindow.assetLoader.addChild(targetLoader);      
  }
 }
}


Everything loads fine, but at the level of quizWindow.assetLoader.addChild (targetLoader), I want to send a message/fill in an area of dynamic text on the main stage. I've been 'parenting' my brain and I'm not sure of how to communicate with that level.

can anyone show me the correct path or the method based on the above, or have a suggestion?


See you soon,.
~ Chipleh

You make me feel nostalgic...

Tags: Adobe Animate

Similar Questions

  • referencing the main timeline from a loaded swf file

    I just poked around google as both of these forums, but the only answer I see that was a success, is kglad, and for some reason that its messages are not, I just see ":" and then the guy say thank you! Not uber useful.

    In any case, I'm just trying to understand how to reference an image tag on my main timeline to a swf loaded (through my imageLoader). Does anyone have a link or can tell me what I should look for in? dispatchers of the event?

    to reference the main timeline of the SWF loading from the main timeline of the swf file that is loaded, use:

    MovieClip (this.parent.parent)

  • Calling a function in the main sequence of a loaded swf file

    I know this is probably a very basic question, but I loaded a SWF file in another film. Now, I want to call a function in the main SWF file. Is it possible to do? Otherwise, I have a custom class where I could put the function, but I was not able to understand how to call it from the SWF loaded either. Can I somehow associate the class with the main movie, or...?

    Nevermind - I did something very stupid and was not calling the function as a method of a clip. I was just calling checkTarget (event) and not event.currentTarget.checkTarget (event); that seems to work.

  • How to target the element of the main stage of in a symbol

    I have a symbol where I want to put an action click here to do something to another item on the main stage, how can I do this?

    Check out my tutorial here:

    Targeting of the symbols: discovering the mystery l EdgeHero

    This was made with a previous version of Animatebut the principles still apply.

    In addition, if you use the snippet window, it will give you good scope.

  • Referring to a button on the main stage of within a movieclip

    I'm banging my head against the wall on this.

    On the main stage, I have a button that I made invisible once the file is loaded.  Inside a movieclip, I have the actionscript 3 code on frame 15

    button_mc. Visible = true;

    I want the button becomes visible at the end of this movieclip.  I do not use an external file as3, I put the as3 code into its own channel on the first image.

    I know it has something to do with the path to the button, but I can't understand it.  If there is someone who can point me in the right direction for the referencing of the authorities with the name of the instance that reside on the main stage of inside a movieclip, I would be very grateful.

    Thank you

    Thepopguy

    Try:

    MovieClip (this.parent).button_mc.visible = true;

  • Just the fact on the integration of 'New private window' Safari to the main stage of the choice of FILE!

    When and where 'New private window' Safari appear on the main stage of the MacBook Pro as a "choice".

    I think that Yosemite > Safari 8 (Yosemite): private browsing using windows

  • Animation of symbols on the main stage

    I have a set of symbols. Each symbol has a rollover animation applied to it.

    Now, I want to be able to animate all these symbols to enter the main stage. This animation plays fine when I hit the button to read within the program, but when I go to preview in the browser, it will not play. I do not have a trigger to stop stop or whatever it is at the beginning of the main animation, so no sense that he would not play. I note that reference is made to the time symbol on the main stage. (chevron back Gray arrows). My individual symbols have a stop at the beginning of each trigger. Only thing I can guess is that trigger the symbols stop is keeping the main animation to play. Probably missing me something simple here, but I thought the symbol only controlled symbol animations and has no effect animations of the main stage.

    All your symbols with play (0) code.

    you might have a table with your symbol names and then a loop for

    var mySymbols = ["cat", "dog", "bird", "cloud", "snake", "rain"];

    for (i = 0; i<>

    sym.getSymbol (mySymbols [i]). Play (0);

    }

  • How to return to the main stage from inside a symbol

    Greetings,

    I'm going absolutely crazy trying to get back to the main stage from inside a symbol.

    To open the symbol on a click of the main stage...

    var mySymbolObject = sym.createChildSymbol ("practiceScene", "Stage");

    It works, I get the symbol

    To return to the main stage from within the symbol on a click...

    sym.getComposition () .getStage () .play () [0]; or sym.getComposition () .getStage () .play ('home');

    This does NOT work, I can't get the symbol.

    Help, please!

    R

    Obliously your symbols are hiding the main timeline. If you put this in your steps, click on events, it will remove the symbols and go to home label.

    I put a square home and hide it when not on the House. Thus, it shows only there.

    sym.getComposition () .getStage () .stop ('home');

    sym.deleteSymbol ();

    So basically, you will need to remove the symbols and recreate them when you need.

    But I could be wrong.

    Here is your file with this correction: I once on home and the other at the opening.

    sym.getComposition () .getStage () .stop ('open');

    sym.deleteSymbol ();

    https://app.box.com/s/aj0zapp11mc98gz3ghtj

  • How to access the chassis lable on the main stage of a nested symbol

    All-

    I have two buttons

    btnA on the main stage

    btnB is nested inside btnA

    How to access a lable of frame on the main stage of btnB

    Hi, zontaluma-

    This should work:

    sym.getComposition () .getStage () .play ("label");

    -Elaine

  • problem with access on the main stage

    Hi, how guys I hope you fine

    Here is my problem

    I have the fla called "game.fla" file and there are a lot of images in the main stage, I want to spend

    class called "admin" in the library but how?

    I tried to this

    parent.gotoAndStop (39);

    but it doesn.t work I do not know why

    and this is the error message

    C:\Users\win7\Desktop\game1\admin1. As line 902 1061: call to a Stop method maybe not defined through a reference with static type flash.display:DisplayObjectContainer.

    right ok, I remember now

    one solution is to replace

    parent.gotoAndPlay)

    with

    MovieClip (parent) .gotoAndPlay (39)

  • ToolTips not working not inside the Embedded Movie Clip but works on the main stage

    Hey,.

    I have a clip which is a browser window, and I try to have some sensitives of the ToolTip on the buttons inside the browser window.

    If I create a button on the main stage, it hovers and works very well, but if I create the same clip inside the embedded browser window, the ToolTip is not displayed.  I have no error messages, but it is not here that I see.

    Any ideas?

    Thank you!

    Even you place your mc in another clip for example NavWindowMC:

    Write code in the maintimeline as

    Fl.transitions.easing import. *;
    Fl.transitions import. *;

    NavWindowMC. mc.addEventListener ('mouseOver', mouseRollOver);
    NavWindowMC. mc.addEventListener ("mouseout/mouseouthandler()", mouseRollOut);
    NavWindowMC. mc.addEventListener ("mouseMove", mouseMove1);

    var tooltip:Tooltip = new Tooltip();
    ToolTip.txt.Text = "Design";
    ToolTip.x = stage.mouseX;
    ToolTip.y = stage.mouseY - NavWindowMC. MC.height;

    function mouseRollOver(e:MouseEvent):void {}
    addChild (tooltip);
    var myTween:Tween = new Tween (Regular.easeIn, 0, 1, 0.5, tooltip, "alpha", true);

    }

    function mouseRollOut(e:MouseEvent):void {}
    removeChild (tooltip);
    }

    function mouseMove1(e:MouseEvent):void {}
    ToolTip.x = stage.mouseX;
    ToolTip.y = stage.mouseY - NavWindowMC. MC.height;
    }

  • Video clip of the main stage

    How can I make a clip back to the main stage, it once... It has a roll that is inside the clip...  I have a door and I want it so when you click on the door, he goes to another keyframe on the main stage

    How can I do this?

    Thank you

    Daniel

    You can always reference the main timeline to use anywhere:

    MovieClip (root)

    (even if it is not the best way of doing things).

  • Do the mounting of the main stage plays in reverse.

    Hey thanks all for research. I figured out how to do this with clips, but I can't do the things with the main stage. Can someone tell me a simple methood of telling the scene to continue to play in reverse, after a button is clicked, until it reaches a keyframe that will tell to stop? I'm trying so buttons will tell the stage to play a transition from the beginning to the end and then have it play in making the turn when you press the back"" button. I am currently looking online to find an answer, but I got no luck yet. Thanks for the help!

    :

    MovieClip (root), .gotoAndPlay (25);

    playF (MovieClip (root), MovieClip (root) .currentFrame, 1);   the root of its current to mount 1 play.

  • Dimensions of the main stage not corresponding with the rest

    Hello
    I just open a new project in Flash. Set the dimensions of the main stage at 1000 x 800.
    That I created a movie clip symbol, which will be on page 1 of the new Web site. The dimensions are 1000 x 800. I import different graphics for the design of this page. When I import this page1 (movie clip symbol) on the main stage, it is much bigger than the main stage. So that page 1 does not fit on the main stage. Could someone tell me what I did wrong or how to fix this?
    Thank you very much for any input and I apologize for this fundamental question.
    See you soon
    Janek

    When you create the instance of MovieClip, there is no canvas when you go to change his "scenario, when you drag the clip from the library to the stage on the main scenario is when you can really judge where the canvas is at... try to test your movie and see what happens. You can create an instance of MovieClip, do nothing for her, drag from the library to the center of the stage on the main timeline, then double-click it to edit it, accordingly, given the canvas gray behind her and to be able to judge where everything will happen.

  • Dynamically loaded swf to communicate with the MovieClip on the stage

    I have a devil of a time here with a problem. I've got an xml document when it is clicked on a certain button on the stage, it loads its corresponding external swf into an empty movieclip on the stage. This empty clip is support for all external SWF.

    So what I'm trying to do, is when an external swf is loaded that has buttons on it, I need these buttons to communicate with the main timeline and delete an mc who is on the stage. I need the swf (s) currently loaded to be able to do. So whatever the currently loaded external swf is loaded, I need to talk to the main timeline. (I have external SWF files a certain need to do this) So I guess I have to somehow target the external swf currently loaded so he could talk to the main timeline.

    The code below in summary does not, but it gives no errors either. I don't pretend to know what I'm doing, and I did not find a solution to this particular problem. If someone could give me advice or direct me to a solution. I would be so happy.

    scenario focus

    var object: index = this;

    function loadComplete (e: Event) {}

    TweenMax.to (index.mcholder, 1, {alpha:. 5});

    Add the current module to the mcholder movieclip according to addChild

    index.mcholder.addChild (e.currentTarget.content);

    (e.currentTarget.content as MovieClip) .addEventListener ("eventTriggered", startListener);

    function startListener(e:Event):void {}

    var ext_swf:MovieClip;

    ext_swf = e.currentTarget.content as MovieClip;

    trace ("external swf");

    ext_swf. Button1.addEventListener (MouseEvent.CLICK, talktomainswf);

    function talktomainswf (): void {}

    TweenMax.to (index.mc_thatsonthestage, 1, {x: 1000});

    }

    }

    Now we have the first load we set to false firstLoad

    index.firstLoad = false;

    }

    function loadError (e: Event) {}

    trace ("Error");

    }

    }

    You can use the event to communicate with external SWF Dispatcher and a main timeline

    as follows:

    //in an external swf
    
    //Once loaded
    function onLoadComplete(event:Event):void
    {
         //dispatch an event in the form of a string
         dispatchEvent(new Event("Talk to Main Timeline"));
    }
    
    //On the Main timeline
    
    //listen for "Talk to Main Timeline"
    stage.addEventListener("Talk to Main Timeline", listenForCallsFromExternalFiles, true); 
    
    //if the event is heard, do this:
    function listenForCallsFromExternalFiles(e:Event):void
    {
         trace("I heard ya, now do stuff...");
    }
    

    That's the idea anyway, I use it all the time.

    hope that helps,

    ~ chipleh

Maybe you are looking for