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.

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)

  • To access the MovieClip instances in a loaded SWF file

    The situation as follows:

    loadedSWF.swf (published with Flash Player 8 AS2 or AS3 of Alpha Flash Player 9), contains on the symbols of the stage with the instance names: clipA, clipB, clipC, etc... No ActionScript is included in the file.

    In a Flex Builder 2.0 project, a component that extends mx.core.UIComponent load loadedSWF.swf:

    script
    var request: URLRequest = new URLRequest ("loadedSWF.swf");
    loaded var: Loader = new Loader();
    Loaded.Load (request);
    addChildAt(loaded,0);


    loadedSWF.swf successfully is displayed in the component's display list, but MovieClip instances that it contains are inaccessible.

    Its existence is verified:

    script
    trace (getChildAt (0)) / / result: [object Loader]
    trace (getChildAt (0) .root) / / result: [object _system_mx_managers_SystemManager]

    However, even if .root getChildAt (0) returns a mx.managers.SystemManager and mx.managers.SystemManager supports the numChildren property, trace (getChildAt (0).root.numChildren) survey error: 1119: access of the numChildren property possibly not defined through a reference with static type flash.display:DisplayObject.. Other methods like getChildAt(), etc. are also impossible to call. Direct access with getChildAt (0).root.clipA also throws an error, etc...

    Is it possible to access instances of the MovieClip on the stage of the loaded SWF file of a component that loads? I would appreciate any advice on this issue.

    a.Neko


    Note:
    The goal is to be able to load multiple clips into a component in a single loading of SWF file, then to instantiate the separately if necessary with addChild() and addChildAt() methods.

    Solution found:

    (Checked for loadedSWF.swf published with Adobe Flash Professional 9 Alpha Public)

    script (excerpt from Flex 2.0 AS3 component class)

    protected var clip: MovieClip = new MovieClip();

    protected final void requestSWF(value:String):void {}
    var request: URLRequest = new URLRequest (value);
    var asked: Loader = new Loader();
    requested.contentLoaderInfo.addEventListener (Event.COMPLETE, this.onRequestSWFComplete);
    requested. Load (request);
    return;
    };

    protected final void onRequestSWFComplete(event:Event):void {}
    event.stopPropagation ();
    This.clip = event.target.content.clipA; conversion of a local variable.
    this.addChild (this.clip);
    return;
    };

    this.requestSWF ("loadedSWF.swf");

    Result: clipA is added separately to the display of the component list.

    a.Neko

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

  • Back to the original timeline of a loaded SWF file

    I'll have one dressed in real problem to the main timline after loading in a SWF file. I created an empty Clip on the main timeline with the code

    _root.loadMovie ("it.swf");

    It works very well, at the end of the child SWF file, I added the code

    _root.gotoAndPlay ("in");

    I have a flag marked "in" on the main timeline that it should return too, I tried to use _global and _level0 instrad of root and they don't work either.

    Ant ideas? This would make my Christmas

    If you have this code inside means of empty magazine,
    You can specify as this.loadMovie ("it.swf");
    Here, this will refer the empty movieclip...

  • Checking the status of the main sequence in reminder PostUUT

    I'm checking the State of the main sequence in the PostUUT callback, running TS 2014 SP1.
    Say, the main sequence generates an error. PostUUT I check and get the following

    Parameters.Result.Status "error".
    Parameters.Result.Error.Code

    Parameters.Result.Error.Msg

    Parameters.Result.Error.Occurred False

    Parameters.Result.Error.Occurred should not be set to True? If this isn't the case, please explain why.

    Thank you.

    In the process model of the step that calls the MainSequence reminder is set to ignore errors.  It is for the rest of your group of main step can run.  That is why we only sets result false but retains all the error information.

    If it were me, I would trigger on the State channel.

    Hope this helps,

  • Go to the list of the results of the main sequence in my plugin...

    Hi guys,.

    OK, first post here, but I'm a little stuck. I am writing a plugin model to generate a custom HTML report (my requirement has a very specific layout for the report, which is not at all compatible with the html reports generated by teststand normally). Anyway. I generated all labview code, I want to make the report in the format I need, but I'm really bad at actually get information of teststand in a way that is easier.

    What I want to do is browse through the list of the results of the main sequence in the callback sequence DUT-Done of the sequence of pluging, which is stored in

    Parameters.MainSequenceResult.TS.SequenceCall.ResultList according to the documentation, but how can I really access it as a table I can go? All I have in my list of parameter is a reference to the parameters. MainSequenceResult, and for the life of me I can't work out what to call this knowledge actually just get it into a format that I can then use to browse in a loop "foreach" to get out of these settings.

    I'm on a windows machine and teststand 2014 7.

    Any help you could give would be really appreciated!

    J

    The list of top level result is: Parameters.MainSequenceResult.TS.SequenceCall.ResultList

    To find it, I dragged Parameters.MainSequenceResult in the Watch window to a breakpoint and developed it until I found the list of results.

    The ResultList is a PropertyObject which is an array of containers, so as the methods GetPropertyObjectByOffset and GetNumElements are going to work on that.

  • How can I include results of a subsequence, which takes place in a new thread in the test report from the main sequence

    Hello!

    I have ", working with the Version 4.2.1 of TestStand. I have a main sequence, which sous-séquences of different calkls. All these steps are reported correctly. One of the subsequences works like "new thread". How can I include his results in the common test report of the main sequence?

    I have variable markes of the subsequence as is required for the test report (it works OK if it's not a new thread). If the digital test, which is performed in this subsequence is correct, I get no results at all. If the digital test could not get a "message in red" who whithout having failed to test any reference to step somewhere in the report of the main sequence or values of vaiables that were not correct.

    I tried an option 'on the fly' in the Configuration of the report, but n ' got no useful result. What should I do?

    Best regards

    Hello Pericles,

    You can use a queue time for the results of the wire once it ends. Place a waiting time after the call to the thread in your MainSequence at the location where you want the results to add to the report (compared to other results). In the waiting step Setup tab, select wait: Thread the threaded sequence, and then select call to specify sequence call the radio button. You can also use an object reference if you need results if poster somewhere where elsewhere - you would just add an object reference to the appeal of sequence threaded in its thread settings dialog box.

    I hope this helps.

    -Jack

  • How to call the function lavel root & variable external loaded swf file

    I have little problem in as3.  I load 'mainmenu.swf' file "main.swf". through class loader. so now "main.swf" is children of parents 'mainmenu.swf' file how can call "main.swf" variable and function of "mainmenu.swf".

    The parent of the loaded swf file is the charger.  The main SWF is the parent of the charger.  Then to communicate with the main storyline of the loaded file can use:

    MovieClip (parent.parent) .someFunction ();

  • call the parent of a loaded swf file functions?

    Hi all

    I have a main Flash file that load other SWF files using loader objects.  I want to be able to call the methods of this main purpose since then in the loaded SWF files.  For example, I want the file loaded in order to add an event listener on the stage of the main file.  I found this example:

    http://flexcomps.WordPress.com/2008/09/01/AS3-calling-MyFunction-on-main-timeline-from-Loa ded - swf.

    That seems to do what I want, but I can't understand how to implement it in my setup.

    My "main" file that loads other sovereign funds is called "main.swf" and has a main document class.

    My loaded file is called start.swf and has a class of documents 'Start '.

    in my main constructor:

    var ethics_content:Loader = new Loader();

    ethics_content. Load (new URLRequest ('start.swf'));

    in the constructor of my departure:


    If (this.parent.parent! = null) {/ / IF the STATEMENT FAILS}
    var parentObj:Object = this.parent.parent as an object;
    trace ("parentObj has been found.'");
    } else {}
    trace ("this .parent .parent is null.");
    }

    stage.addEventListener (MouseEvent.CLICK, handle_click); GENERATES AN ERROR WHEN IT IS LOADED TO THE HAND. SWF

    trace ("step: ' + Stadium");  RETURNS A [STAGE] OBJECT BY OPERATING BY ITSELF, BUT NULL WHEN IT IS EXECUTED IN THE HAND. SWF
    trace ("root:" + root); RETURNS AN OBJECT [START] WHEN RUN BY ITSELF OR WITHIN THE HAND. SWF
    trace ("parent: ' + parent"); RETURNS A [STAGE] OBJECT BY OPERATING BY ITSELF, BUT NOTHING OF IN THE HAND. SWF
    trace ("this .parent:" + this.parent); RETURNS OBJECT STAGE ITSELF, NOTHING OF IN THE HAND. SWF
    trace ("root.parent:" + root.parent); RETURNS THE SCENE OBJECT BY ITSELF

    How to get to the scene of a loaded SWF file?  Or at least, how can I call a function in my main class from the loaded file start.swf so I can move the functionality I need the main.swf file?

    Any help is greatly appreciated.

    If your main swf loader is not added to the display list when it try {branch} is running, the charger will not have a parent.

  • Transfer data from DoPreUUT to the main sequence

    Hi all, I am working on editing a sequential model existing in NI TestStand.

    In PreUUT do that I just wanted to have mu, own VI Custom which will require a path and once the path is selected, the VI will extract 2D Array of string values that I have to move my hand Sequence.I am facing a question of transfer data from table 2D-doPreUUT to mu from the main sequence.

    http://forums.NI.com/T5/NI-TestStand/pass-parameters-from-PreUUT-to-main-SEQ/m-p/2850684#

    who says the best way is to use the globals file, but I'm not able to get my values transferred to my main sequence.

    Need help to solve...

    Thanks in advance

    If you are adding a FileGlobal to Test DUT and expecting to access this variable in your file of the client's sequence, you will not be able to read the FileGlobal directly. You will need to use the "RunState.Root.FileGlobals" string... »

    for example if you have an array of strings FileGlobals.MyDataPaths you MainSequence, you can access using RunState.Root.FileGlobals.MyDataPaths of MyDataPaths.

    Remember that this will only be available when you use the process model, therefore, it would be wise to test that you run with the process template.

    Hope this helps

  • Note the serial number of the UUT in the main sequence

    Hello

    I want to write the serial number of the object to be measured on the main sequence.

    I know that I can access this value through RunState.Root.Locals.UUT.SerialNumber. I can write the serial number in this variable and it works as long as the report is not generated on the fly. If activate on the fly to have pointed out, my serial number of UUT report rest to 'NONE '.

    Is it possible to force the regeneration of the report with the last value of variables? I noticed that there's something similar for the runtime. During the execution of the sequence, on-the-fly feature enabled, the report indicates "0 seconds" for the period of performance. However, when execution is complete, this report field is updated with the actual value.

    How to do the same for the serial number?

    Thank you

    Alex

    OK, ATML seems to create the problem. Using XML reports, it works as expected. What is a work around for you?

    Norbert

    EDIT: Classified CAR 491296 against ATML OTF reporting

  • Add Label (and other things like SequenceCall, statement etc.) on the main sequence?

    Hi all

    I try to add the label on the main sequence, but the problem is how to run there. Have been made successfully subsequences and their content, but I now want to add content in the main sequence (labels, SequenceCall, statement etc.). You can someone help me with this code? (CVI/LabWidows). This code seeks to add labels (szName) on the main sequence.

    Before entering the Label, have referred to the hand in the file in the sequence. The missing part.

    tsErrChkMsgPopup (TS_EngineGetSeqFileEx (EngineHandle, & errorInfo, SeqTemplate_path,  TS_GetSeqFile_DoNotRunLoadCallback, TS_ConflictHandler_Prompt, & SequenceFileHandle));
    tsErrChkMsgPopup (TS_EngineNewStep (EngineHandle, & errorInfo, '',' Label', & labelStep));
    tsErrChkMsgPopup (TS_StepSetName (labelStep, & errorInfo, szName));
    error = TS_SequenceInsertStep (SequenceFileHandle, & errorInfo, labelStep, indexL, TS_StepGroup_Main);

    I tried with TS_SeqContextGetMain(), but does not work.

    Best regards

    branar

    Hi Ray,

    reason why is used SecuenceFileHandle was I have change the existing file (only not by creating a new). Simply, add subsequences of default file and save as a different name. Problem is now solved by

    TS_SeqFileGetSequenceByName (SequenceFileHandle, NULL, 'MainSequence', & SequenceHandle)

    I get "MainSequence" and adding animals here. Previously, MainSequence has been created and two sequences with the same name were existi.

    Best regards

    branara

  • Calling a function in the HTML window that course is located inside - 8 Captivate

    Hello

    I scoured the forums to answer this but still have developed in white.

    Our LMS is launching a course in a pop-up window and inside that the Captivate output file .htm lies.

    Currently this pop-up window has a button that performs a function.  The problem is this button is rather unsightly sitting above the price in the HTML window and I wish I could call this function inside the Captivate course itself.

    The function is called closeSCOContent() and it closes the window of course but basically sends the user to a page of comments.

    So, basically is it possible to call this function using the Javascript function in Captivate 8?

    I hope that I have explained that sufficient

    Thank you very much!

    You should be able to call the function, but you would need to know where he is regarding parents/children/opener. Looks like there's frameset inside the popup.

  • Can I call a function using the array index?

    I defined a table that stores the name of the function, like this:

    var aresetButtonTop:Array = new Array(resetTop1,resetTop2,resetTop3,resetTop4,resetTop5);

    Then I have a button named "btnresetTop" which, once clicked will be called one of the five functions stored in the array (aresetButtonTop) above. Functions are called at runtime depending on certain conditions. I need to figure out how I can call these functions using the array index. I use the following code to call the function. The value of i has already been calculated.


    btnresetTop.addEventListener (MouseEvent.CLICK, aresetButtonTop [i]);

    After doing this, I get the following error when I click on the button:

    TypeError: Error #2007: parameter listener must be non-null.
    at flash.events::EventDispatcher/addEventListener()
    at gallerytest_fla::MainTimeline/thumbTopClick()

    Note: thumbTopClick() is a function within which all these codes are written.

    I need to know if it is posible in AS3 to call a function name using array index or not. If so, could you afford ehelp me out.

    You can certainly do.

    In your case, it looks like i is out of range. Show your loop.

Maybe you are looking for

  • iPad black screen.

    When black when he was on the screen.   tried the power and the home button at the same time.   then hung from my macbook to see if I can get through iTunes.   also hit the back of the iPad nada suggestions?

  • Cluster successively reading

    Hello I hope that I will word my understandable problem I have a cluster of clusters and now I want to do something with each cluster in the large cluster. So a loop would be nice. But I don't know how I can use a cluster after another in a loop. Tha

  • Cannot find bluetooth HP Notebook G82

    I have a HP G62 Notebook PC win 7 64 bit model CNF1010S49 and I don't have bluetooth.  Where is he?  Also, browsers crash much more in Facebook - no idea why?

  • Win XP SP3 installs not because of disk space, but I have 50 GB of available disk space

    I tried to install Win Xp SP3 update and still get the message that it cannot install because space low disk.  I erased the disc as possible and I have 50gigs of free space, but I still get this error.  How much space do I need?

  • Need a DVD to install Vista on a new HD

    I bought this computer in June 2007.  My wife uses it and loves it.  The hard drive crashed and I installed a new disk and the computer recognizes it.  But I do not have a disk to reload the operating system.  My verification code is the bottom of th