How the get function is available or not on the loaded swf file

I have 100 swf file in one of my projects. And there is a common feature in some of the SWFs. All these files are loadded in the file main.swf. Here's my Question, "If have the common function is the swf file that is loaded, int how to trigger this funciton of the main.swf.

Quite simply,.

            if(movieclip.test){
                movieclip.test();
            }

('movieclip' is the loaded SWF file and "test()" is the function)

Tags: Adobe Animate

Similar Questions

  • control the loaded swf file

    Hi all

    I am loading a swf into another SWF, I want to controll loaded swf such as play and pause the swf. The loaded swf file is an animation file, all animations are kept in a movieclip, then please tell me how I can control the animation.

    In your first assignment, you tell the animation is present in a movieclip.  If this movieclip is in the loaded swf file you will probably need to target this movieclip to tell him to play rather than the SWF itself, as in...

    currentSWF.movieclipName.play ();

    where movieclipName is replaced with the name of the instance of movieclip in the loaded swf file.

  • How to get the size of the loaded swf file?

    final/public class main extends Sprite
    {

    public void main()
    {
    loaderInfo.addEventListener (Event.COMPLETE, _onLoadCompleted);
    }

    private void _onLoadCompleted(event: Event): void
    {
    var tw: int = stage.width;
    var e: int = stage.height;
    TSW var: int = stage.stageWidth;
    tsh var: int = stage.stageHeight;

    }

    }

    Above is my project simple as3 in flex builder 3.

    My screen resolution is 1920 * 1080, when debugging, the SWF is stretched to the full EI client area, but the stage.stageWidth is 500 and the stage.stageHeight is 375, stage.widht and stage.height are 0, who can tell me why and how to get the right size of the SWF, named the area size customer of EI in this situation?

    Thank you very much!

    The HTML wrapper can resize the SWF later, so wait a frame and recheck stageWidth/stageHeight.

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • Child of the loaded SWF file

    I read through many of the forum discussions and articles, but I still can not quite understand it. Here's my basic configuration: container > LoadedSWF file > MovieClip. I want to access this clip that is in the swf file loaded into the container.

    Loading code is inside a class that is directly associated with an empty MovieClip on the stage. Here are the relevant parts of the code:

    public var loadDrawing:Loader = new Loader;

    drawLoad = "E002.swf";

    loadDrawing.load (new URLRequest (drawLoad)); I loaded the drawing in loadDrawing

    That's essentially what I want, but it doesn't exactly work like this:

    jumpNumber = "j1". This is the name of the instance of the clip I want control

    loadDrawing.drawLoad.jumpNumber.x = 100;


    That way I can control this MovieClip which is in the swf file, which the magazine is. Also, I have to wait for the video to load completely before I try to access the elements contained in it, right?

    >>

    jumpNumber = "j1". This is the name of the instance of the clip I want control

    loadDrawing.drawLoad.jumpNumber.x = 100;

    If you want to use a string as you show here so you need to use the media access as follows:

    loadDrawing.drawLoad [jumpNumber] .x = 100;

    or else just like:

    loadDrawing.drawLoad.j1.x = 100;

    However, you also need to cast loadDrawing.content to a MovieClip to be able to do... If actual code would be like:

    MovieClip (loadDrawing.content) .drawLoad [jumpNumber] .x = 100;

    or else just like:

    MovieClip (loadDrawing.content).drawLoad.j1.x = 100;

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

  • How can I remove eventListener on the main time line off the loaded SWF?

    I have a Workbench where my main timeline is retouching of the marked sections. In one of the marked sections I have load and SWF file using greensock SWF Loader. In the loaded SWF file, there is a command where I need to remove/addEventListeners on the main timeline of the flash file in the loaded SWF file.

    The establishment with "MovieClip (parent.parent.parent.parent)." works for the navigation and loading and other functions. However, I get the error "1120: access of property unidetified" if I want to use a line of code like this:

    MovieClip (parent.parent.parent.parent) .mainNav_buttonsGroup_mc. Applications_b tn_mc.removeEventListener (MouseEvent.ROLL_OVER, overHandler_Applications_btn);

    I'm just writing this EventListeners again in the SWF file loading (thus repeating once again that they are specified on the main time line already) or there is a better method for her?

    appImgBtns_mc.testBtns2_mc.addEventListener(MouseEvent.CLICK, onClick_testBtns2);
    
    
    function onClick_testBtns2(event:MouseEvent) :void {
              /////////
                        ////disabling the button onClick by removeEventListener
                        //MovieClip(parent.parent.parent.parent).mainNav_buttonsGroup_mc.Applications_btn_mc.removeEventListener(MouseEvent.ROLL_OVER, overHandler_Applications_btn);
                        //MovieClip(parent.parent.parent.parent).mainNav_buttonsGroup_mc.Applications_btn_mc.removeEventListener(MouseEvent.ROLL_OUT, outHandler_Applications_btn);
                            //MovieClip(parent.parent.parent.parent).mainNav_buttonsGroup_mc.Applications_btn_mc.removeEventListener(MouseEvent.CLICK, onClick_Applications_btn);
                        ////coloring the button
            MovieClip(parent.parent.parent.parent).Applications_btn_timeLine.play();
      
                        //Products_btn_mc
                        //MovieClip(parent.parent.parent.parent).mainNav_buttonsGroup_mc.Products_btn_mc.addEventListener(MouseEvent.ROLL_OVER, overHandler_Products_btn);
                        //MovieClip(parent.parent.parent.parent).mainNav_buttonsGroup_mc.Products_btn_mc.addEventListener(MouseEvent.ROLL_OUT, outHandler_Products_btn);
                        //MovieClip(parent.parent.parent.parent).mainNav_buttonsGroup_mc.Products_btn_mc.addEventListener(MouseEvent.CLICK, onClick_Products_btn);
                        //discoloring the button
            MovieClip(parent.parent.parent.parent).Products_btn_timeLine.reverse();
      
      
              MovieClip(parent.parent.parent.parent).sourceVar_AppPopUpsLoader_fromPrdcts="images/app_images/original/icysophistication_new_tl.swf";
              MovieClip(parent.parent.parent.parent).gotoAndPlay("appPopUps_fromPrdcts");
    }
    
    

    You can communicate with the main timeline by dispatching events from the child swf file.

    When the child Swf is loaded, dispatches an event, i.e. - dispatchEvent (new Event ("DoTimeLineCode"));

    Then on your main timeline, listen for the event and perform the desired functions:

    MovieClip (root) .addEventListener ("DoTimeLineCode", mainTimeLineFunctions);

    function mainTimeLineFunctions(e:Event):void

    {

         MovieClip(root).Applications_btn_timeLine.play();

    etc...

    }

    ChasingMovieClip(parent.parent.parent.parent) has always been a losing battle for me. It's best practice to use event dispatchers and listeners to instantiate "things" from the parent child paradigm.

    ~ Chipleh

  • Communicate with the embedded SWF files

    So if I have several external swf into one big, how can I communicate with each other?

    More specifically,.

    -the swf principal needs to know when the keys were pressed in a shipped, and he needs to tell you all the other included those on this subject.

    -embedded SWFs must intelligently resize and shuffle around each other, while keeping their origins coordinated in the upper corner.

    How can I go about it?

    As long as you mean by "shipped" you load swf files in you main file dynamically, then there is hope for all that you have planned.  If you mean that import you into the library by embedded and plant them in the chronology of the main file, that does not work.

    The other event and the event or Manager is coded in the main SWF.  Are the code loaded SWF to displatch events than the main file of the headphones for.  If simply scream of the loaded swf when they will, not for mutual assistance who hears him... allowing them to compile without dependence on the master file.

    If in the film loaded, which triggers the need to rehabilitate the main file in action would send an event as follows...

    dispatchEvent (new Event ("eventName")); name of the event you want to

    To add the listener in your main swf file, listen for the complete event of load on the Loader.contentLoaderInfo which is used to load the file.  In the complete event handler, add the listener for the event on the loaded swf file.

    function loaderCompleteHandler(e:Event) {}
    MovieClip (e.currentTarget.content) .addEventListener ("eventName", eventHandler);
    }

    function eventHandler(event:Event):void {}
    trace ("load swf triggered event");
    }

  • Calls to functions from loaded SWF files

    I have a Flex application that uses the SWFLoader object to load an external SWF file (which has also been developed in Flex) in a section of the page. The parent SWF file defines several variables and global functions in ActionScript I would use from all SWF files loaded in the SWFLoader. Is it possible in ActionScript to access the functions and variables that are defined in the SWF file the SWF load/child parent? The two SWF files are on the same domain, so there should not be problems of security.

    Peter thank you very much for your answer. I have tried loading in the same ApplicationDomain, but he did not what I expected from him. I, however, found the solution to my problem. I needed to understand how cross-script from a SWF file loaded the loaded SWF file. I discovered how and published a description of my conclusions on another thread that was no longer relevant to my question. The described solution has allowed me to do what I needed without touching the ApplicationDomain.

  • prevent the loaded swf to loopback

    Hello world

    I am loading a swf file into a swf of controller, and thanks to the help I received on this forum, I am able to control the swf loaded with play and pause buttons.  I have another question, and this is how to prevent the loaded swf file looping.  I wish that the swf loaded to play its last picture and stop.  I have the following code and it works with an error.  I'm assuming that the error is coming because the service runs before the swf file is loaded.

    var myLoader = new Loader();
    var myURL:URLRequest = new URLRequest ("box.swf");
    myLoader.load (myURL);
    addChild (myLoader);

    pause_btn.addEventListener (MouseEvent.MOUSE_UP, onClickPause);
    play_btn.addEventListener (MouseEvent.MOUSE_UP, onClickPlay);

    function onClickPause(evt:MouseEvent):void {}
    MovieClip (myLoader.content) .stop ();
    }
    function onClickPlay(evt:MouseEvent):void {}
    MovieClip (myLoader.content) .play ();
    }

    the following works with a guy

    stage.addEventListener (Event.ENTER_FRAME, stopPlay);

    function stopPlay(e:Event):void {}
    If (MovieClip (myLoader.content) .currentFrame is {MovieClip (myLoader.content) .totalFrames)}
    MovieClip (myLoader.content) .stop ();
    trace ("End");
    }
    }

    The error reads as follows:

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

    Once again, any help would be greatly appreciated.

    Thank you!

    -Dave

    Use COMPLETE earphone that kGlad offered to wait to assign the ENTER_FRAME listener.

    var myLoader = new Loader();
    var myURL:URLRequest = new URLRequest ("box.swf");
    myLoader.load (myURL);

    myLoader.contentLoadInfo (Event.COMPLETE, loadCompleteF);

    function loadCompleteF(e:Event) {}

    stage.addEventListener (Event.ENTER_FRAME, stopPlay);

    }

    addChild (myLoader);

    pause_btn.addEventListener (MouseEvent.MOUSE_UP, onClickPause);
    play_btn.addEventListener (MouseEvent.MOUSE_UP, onClickPlay);

    function onClickPause(evt:MouseEvent):void {}
    MovieClip (myLoader.content) .stop ();
    }

    function onClickPlay(evt:MouseEvent):void {}
    MovieClip (myLoader.content) .play ();
    }

    function stopPlay(e:Event):void {}
    If (MovieClip (myLoader.content) .currentFrame is {MovieClip (myLoader.content) .totalFrames)}
    MovieClip (myLoader.content) .stop ();
    trace ("End");
    }
    }

    You can also use a stop(); command at the end of the timeline of the swf file that is loaded instead.

  • 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

  • I keep getting these messages that do not allow to use a file. What should I change to have privileges for all functions?

    Original title: administrator Win7

    I have win7 and IE11 running on a HP 8540p.  I'm the only person authorized to use the laptop - I am the administrator.

    I keep getting these messages that do not allow to use a file.  What should I change to have privileges for all functions?

    The second file is not cooperating and was not deleted.

    "Not cooperating" can mean many different things. A real verbatim error message would be more useful. In the case of locked files, it is often possible to remove safe mode.

  • How to unload the external .swf file when pass the other section?

    Hello

    The following code provided by Mr. kglad works very well to load an external .swf file on stage. Now, when I click on Contact (button), the file external .swf to disappear completely. How to encode on contact (button) to get by.

    Gallery.addEventListener (MouseEvent.CLICK, GalleryClick);

    function GalleryClick(e:Event):void {}

    If (currentClip! = Gallery_mc) {}

    currentClip.visible = false;

    Gallery_mc. Visible = true;

    currentClip = Gallery_mc ;}

    var loader: Loader = new Loader();

    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, ClipLoaded);

    Loader.Load (new URLRequest ("Gallery.swf"));

    function ClipLoaded(e:Event):void {}

    Gallery_mc. AddChild (Loader);

    Loader.x = 0;

    Loader.y = 120;

    Loader.Width = 1000;

    Loader.Height = 700

    }}

    I tried the following code for Contact_btn unload the Gallery.swf file that launches an error message: 1120: access of undefined property loader.

    Contact.addEventListener (MouseEvent.CLICK, ContactClick);

    function ContactClick(e:Event):void {}

    If (currentClip! = Cotnact_mc) {}

    currentClip.visible = false;

    Cotnact_mc. Visible = true;

    currentClip = Cotnact_mc;

    Gallery_mc.removeChild (loader);}}

    unloadAndStop() is supported by flash player 10 or higher (fp 10 +).

    p.s. Please check the useful/correct, if there is.

  • How to get my homepage index.html to stand, I've added files?

    Hello

    How to get my homepage index.html to stand, I've added files?

    I created folders in the root and Idex.htlm file, but when I ADDED a file to the file, the INDEX or photos. Files HTML moves downwards.

    see you soon,

    Dreamer.101

    I do not think too that you can have the index at the top of the "stack".

    However, you can group the files / folders by Type, Date modified and file size by double clicking on the topic at the top of the File Manager.

    --

    Nadia

    Adobe Community Expert: Dreamweaver

    ---------------------------------------------------------------

    Unique templates CSS | Tutorials | SEO articles

    http://www.DreamweaverResources.com

    --------------------------------------------------------------------------

    Web Design & development

    http://www.perrelink.com.au

    http://Twitter.com/nadiap

  • How to determine the total number of images in the external .swf file loaded

    I have to be able to load both external .swf files and make them play in order. To do this, I need to know the number of images in the first .swf file so I can check _currentframe against _totalframes to determine when he is finished playing so that I can load another.

    Most of the stuff I see indicate that _totalframes on an external .swf can be determined by loading the .swf in a container clip and then check using a listener in the .onLoadInit. Like this:

    ------------------------------------------------------------------------------------------ ----------------------------

    this.createEmptyMovieClip ("tester_mc", 1);
    var mcListener:Object = new Object();

    mcListener.onLoadInit = {function (target_mc:MovieClip)}
    target_mc.onEnterFrame = function() {}
    If (this ._currentframe > = this ._totalframes) {}
    trace ("total frames =" + this ._totalframes);
    delete this.onEnterFrame;
    } else {}
    trace (target_mc._currentframe + "OF" + target_mc._totalframes);
    }
    }
    }

    var test_mc:MovieClipLoader = new MovieClipLoader();
    test_mc. AddListener (mcListener);
    test_mc.loadClip ("Ad_Group.swf", tester_mc);

    ------------------------------------------------------------------------------------------ -------------------------------------

    Unfortunately, this doesn't seem to work. The trace will always return a total number of frames of 1.

    I guess it's because the container clip has only 1 frame, and the external .swf timeline seems to be ignored.

    I would appreciate any ideas on how to raise the total number of frames of an external .swf file or, Alternatively, put it another way when it's done playing. (Not only the loading, but play until the end.)

    TIA,

    C

    I guess it's because the container clip has only 1 frame, and the external .swf timeline seems to be ignored.

    I wouldn't imagine. My guess is that the main scenario for the external swf file has only 1 frame and the rest of the animation is inside a movieclip in this timeline. You publish this swf? Can you open the FLA and check how many images is open on the main timeline?

    The approach that you have mentioned is about what there is. But he knows check a chronology. If there are many nested movieclips, it may be impossible to understand what timeline you really want to be 'THE' full chronology.

    If you have the FLA, you can have the video call function on the _root timeline which tells the main swf that has completed a movieclip or something like that.

    Also, I have in my head somewhere that I recently saw something that someone made similar to this one, but do not remember... If it appears in my head that I will post.

Maybe you are looking for

  • I want icon to stay there until I have openedd messages.

    When reinstalled Thunderbird hard drive replaced. Now the tray re icon new messages only very briefly, there rather than to what messages have been opened - which is what I'm used to I want to come back. Why this feature has disappeared? I had it bef

  • How to install XP - need the version of idiots

    Hello I read through some of the threads on this forum regarding the installation of XP in a partition and I understand that you must go to the Toshiba website and download all the drivers for XP first and then put them on a CD (?) and then start you

  • Download itunes vs updated to itunes, windows 7

    I have a new 6 s iPhone that is forces me to upgrade to a later version of iTunes when I connect to my laptop. I need to restore my iPhone with my last backup to iTunes. I am currently on iTunes 12.1.2.27, windows 7.  When I go to help > check update

  • ASA of asymmetric routing

    Hi all Having an ASA anyconnect and s2s tunnels running. Goal: enable anyconnect to users access to resources on ipsec tunnel. Problem: anyconnect users and s2s tunnels using the same outside the interface. Applied configuration: 1. permit same-secur

  • Bluetooth blackBerry Smartphone problem

    I'm looking for the problem of Bluetooth of BB Torch 9800, it is written somewhere in the mobile device? Or who is his number?