Load an SWF and control

Hi,
I want to know if you can load an SWF into another SWF and
control it for example:
load SWF b into SWF a and control SWF b from SWF a
is this possible because I want to be able to trigger a
particular mc or frame in SWF b but do it from SWF a?
Cheers
Scott
Text
Text

yes and yes: wait until loading is complete and then
reference the target movieclip or _level of your loadMovie(),
loadMovieNum() or loadClip() method.

Similar Messages

  • Load internal SWF and control other SWF

    I have 96 questions with radio button responses that control
    movie clips. They are all in the same swf but I want to separate
    the questions and put them in a draggable, scalable movie clip so
    that the user could move the question box as convenient. Most of
    the ActionScript is associated with the MCs, responding to a radio
    button listener object. The two SWFs must advance from frame to
    frame synchronously.
    Here is what I did:
    1. Split the original FLA into 2 pieces, a MC FLA and a
    Question FLA
    2. Renamed rbListener as _global variable in MC FLA
    3. Used this code in the MC FLA:
    this.createEmptyMovieClip("loadQuestions_mc",
    this.getNextHighestDepth());
    loadQuestions_mc._height = 400;
    loadQuestions_mc._width = 600;
    loadQuestions_mc.onPress = function():Void {
    this.startDrag();
    loadQuestions_mc.onRelease = function():Void {
    this.stopDrag();
    loadQuestions_mc.createEmptyMovieClip("containQuestions_mc",
    this.getNextHighestDepth());
    loadMovie("mccolor4_SplitBottom.swf", containQuestions_mc);
    4. Used this code in the first frame of Questions FLA:
    function specifyListeningTargets () {
    i = cellNumber;
    eval("QA" + i).addEventListener("click", rbListener);
    eval("QB" + i).addEventListener("click", rbListener);
    eval("QC" + i).addEventListener("click", rbListener);
    // Button pops up at x:400, y:600, What is 10? Depth?;
    clicking button advances to next frame.
    function popupNav () {
    i = cellNumber
    if (((eval("QA" + i).selection.data) > 0),
    ((eval("QB" + i).selection.data) > 0),
    ((eval("QC" + i).selection.data) > 0)) {
    this.createClassObject(mx.controls.Button, "popupNext_btn",
    10, {label:"Go To Next Questions"});
    popupNext_btn._width = 20;
    popupNext_btn.move(250, 375);
    function popupClicked() {
    this.nextFrame();
    _parent.nextFrame();
    popupNext_btn.addEventListener("click", popupClicked);
    5. Used this code in each frame of the Questions Fla:
    stop();
    cellNumber = 1;
    popupNext_btn._visible = false;
    popupNav ();
    specifyListeningTargets();
    Text

    yes and yes: wait until loading is complete and then
    reference the target movieclip or _level of your loadMovie(),
    loadMovieNum() or loadClip() method.

  • Loading external swfs and controlling their actionscript

    I'm in need of some tutorials/examples for loading external
    swfs placed in empty movie clips using loadmovie into the main
    movie.
    I have actionscript and alot of interactive features within
    these loaded swf files and I'm having a heck of a time figuring out
    how to code and path the AS from them to work in the main timeline.
    I'm also open to using loadMovieNum and working with levels
    if it might be easier, however I'd like to keep this as simple as
    possible.
    PLEASE ANY HELP!!!????

    I am by no means an expert however it is my understanding
    that if you have a loaded swf within your main application and you
    wish to control features on the main timeline you need to use the
    _root function.
    Without knowing exactly what type of controlling you need
    it's hard to explain in great detail.

  • Loading multiple SWFs and storing them (code not working under Firefox 23 and Chrome)

    Hey guys,
    Anyone has any idea why this code suddenly don't work anymore? (It works under internet explorer but not firefox and chrome
    The code under is placed on my main swf to preload all my external swfs and store them for not having to wait too long to access them.
    Thx guys.
    I took the code from here btw: http://www.beautifycode.com/the-finer-art-of-loading-2-handling-multiple-swfs#snippet
    I'm running flash player 11.8.800.94... It used to work under Firefox and Chrome
    var _swfLoader:Loader;
    var _swfRequest:URLRequest;
    var _swfPathArr:Array = new Array("00.swf", "01.swf", "02.swf");
    var _swfClipsArr:Array = new Array();
    var _swfTempClip:MovieClip;
    var _loadedSWFs:int;
    startLoading(_swfPathArr);
    function startLoading(pathArr:Array):void {
    _swfLoader = new Loader();
    _swfRequest = new URLRequest();
    loadSWF(pathArr[1]);
    function loadSWF(path:String):void {
    setupListeners(_swfLoader.contentLoaderInfo);
    _swfRequest.url = path;
    _swfLoader.load(_swfRequest);
    function setupListeners(dispatcher:IEventDispatcher):void {
    dispatcher.addEventListener(Event.COMPLETE, onSwfComplete);
    function onSwfComplete(event:Event):void {
    event.target.removeEventListener(Event.COMPLETE, onSwfComplete);
    _swfTempClip = event.target.content;
    _swfTempClip.customID = _loadedSWFs;
    _swfClipsArr.push(_swfTempClip);
    if(_loadedSWFs <_swfPathArr.length - 1) {
    _loadedSWFs++;
    loadSWF(_swfPathArr[_loadedSWFs]);
    } else {

    Hi kglad,
    The problem was coming from my server.
    I recently played with some settings  from a "cache control tool" offered by my hosting but i thought i had it back at default. Turns out i must've missed something. Now i have the .html caching on and everything works good on all browser.
    I have another question tho...
    I'd like to know if there's a way to cache an html file without having to ask my hoster to cache all of my htmls...
    I'm using this code now but maybe there's a way to add something that will cache this page specifically?
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>title</title>
    <script language="javascript">AC_FL_RunContent = 0;</script>
    <script src="fluid_site.js" language="javascript"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
    <link href="style.css" rel="stylesheet" type="text/css" media="screen"/>
    </head>
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <!-- saved from url=(0013)about:internet -->
    <script>
        if (AC_FL_RunContent == 0) {
            alert("This page requires fluid_site.js.");
        } else {
            AC_FL_RunContent(
                'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
                'width', '100%',
                'height', '100%',
                'src', 'index',
                'quality', 'medium',
                'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
                'align', 'middle',
                'play', 'true',
                'loop', 'true',
                'scale', 'showall',
                'devicefont', 'false',
                'wmode', 'window',
                'id', 'index',
                'name', 'index',
                'menu', 'false',
                'allowFullScreen', 'false',
                'allowScriptAccess','sameDomain',
                'movie', 'index',
                'salign', ''
                ); //end AC code
    </script>
    <body>
    <noscript>
        <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="100%" height="100%" id="index" align="middle">
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="allowFullScreen" value="false" />
        <param name="MENU" value="false">
        <param name=wmode value=window>
        <param name="movie" value="index.swf" /><param name="quality" value="medium" /><embed src="index.swf" quality="medium" width="100%" height="100%" wmode="direct" name="fluid_site" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
        </object>
    </noscript>
    </body>
    </html>
    Thanks

  • Loading External SWF and setting variables

    Hello Everyone.
    I'm sure you are all a where of the FlashVars attribute for
    Flash embeds which holds variables for SWF's when they are
    rendered. I'm attempting to load an External SWF dynamically
    from within my own SWF and need to provide it with the values
    normally stored in the FlashVars. For the example below I
    wait until the External SWF is completely loaded using the
    onLoadInit event from moviecliploader and then i attempt to
    set the required variables that the loaded SWF needs. This works
    great in test and debug mode (ie. Test Movie and Debug Movie
    from the Control menu), but when i publish my FLA to SWF and run
    the SWF the variables will NOT get set in the loaded External SWF.
    From my readings ive people have mentioned that the player is only
    able to access Methods of an External SWF. If this is the case then
    how do they expect people to set the FlashVars of dynamically
    loaded SWFs? I investigated the loadVariables procedure as well and
    had the same results in test mode and was wasn't reliable because
    of timing issues.
    The sample source is below... if anyone has any ideas or has
    come across this issue before, I would really appreciate some
    insight.
    Thank you in advance for your time.
    var loader_mc:MovieClipLoader = new MovieClipLoader();
    var mclListener:Object = new Object();
    loader_mc.addListener(mclListener);
    mclListener.onLoadProgress = function(target_mc:MovieClip,
    numBytesLoaded:Number, numBytesTotal:Number) {
    // DO NOTHING
    mclListener.onLoadComplete = function(target_mc:MovieClip) {
    // DO NOTHING
    mclListener.onLoadInit = function(target_mc:MovieClip) {
    // WORKS IN TEST MODE NOT IN PUBLISH/SWF MODE
    target_mc._root.param1 = "value1";
    // WORKS IN TEST MODE NOT IN PUBLISH/SWF MODE
    _level0.container_mc.param1 = "value1";
    this.createEmptyMovieClip("container_mc",
    this.getNextHighestDepth());
    container_mc._lockroot = true;
    loader_mc.loadClip("somecoolflash.swf", container_mc);

    I've tried that as well and it behaves the same as onLoadInit
    ... Works when i test but doesnt when i publish to a swf. I think
    this is security related and the flash player just cant write to a
    loaded swf and set variables.

  • Start up pause/hang before loading A-Dock and Control Strip

    Ok, I know, running a sooped up 7200 PowerMac is not worth the time or money, but...I've got this hang that's become more pronounced lately.
    Everything seems to load fine. After about 3-5 minutes A-Dock and Control Strip come one. Already tried disabling both, no luck. That's why I think the mouse is the problem. Logitech Wheel mouse works but not to full functionality (gonna try USB Overdrive); Mouseware 4.0.6 now installed but seems flaky (RH and wheel button work intermittantly, usually after replugging in the USB), and can't seem to locate the install CD which had an earlier version. May also try the serial mouse again too.
    Mouse also hangs in some browsers and seems to cause crashes.
    I've got a SCSI external drive (IDE 6) and terminated.
    I'll do more testing, but would appreciate any obvious fixes
    Thanks in advance

    Do you have the problem if you start up with Extensions Off?
    A problem on the SCSI bus can cause your problem. Disconnect all external devices except kbd, mouse & monitor and see if you have the same problem.
    Not sure it will help, but won't hurt to zap PRAM also.
    Cheers, Tom

  • Loader, Unload SWF and Warning: Ignoring 'secure' attribute........

    Hey all
    I was just simply trying to load one swf into another.  in my document class I have the following line of code in my constructor.
    var loadBoard:LoadBoard = new LoadBoard("Directory.swf");
    in my LoadBoard class:
    package com.myproject
         import flash.display.Loader;
         import flash.display.MovieClip;
         import flash.net.URLRequest;
         public class LoadBoard extends MovieClip
              public function LoadBoard(nameOfBoard:String)
                   var boardLoader:Loader = new Loader();
                   addChild(boardLoader);
                   boardLoader.load(new URLRequest(nameOfBoard));
                   trace("swf should be loaded");
    In my console I get the following when I debug"
    [SWF] U:\fullPath\Directory.swf - 69,058 bytes after decompression
    [SWF] U:\fullPath\Directory.swf - 2,067 bytes after decompression
    [SWF] U:\fullPath\Directory.swf - 322,606 bytes after decompression
    [SWF] U:\fullPath\Directory.swf - 112,558 bytes after decompression
    [Unload SWF] U:\fullPath\Directory.swf
    Warning: Ignoring 'secure' attribute in policy file from http://fpdownload.adobe.com/pub/swz/crossdomain.xml.  The 'secure' attribute is only permitted in HTTPS and socket policy files.  See http://www.adobe.com/go/strict_policy_files for details.
    Not sure why I am getting this warning, when I googled it, the erro has to do with trying to load a file from another domain. My Directory.swf file is in the same location as my main swf, the bin-debug folder.  Also the Directory.swf does not seem to load into my main swf as I don't see it show up in the flash player when i run my app.   I am also a little confused on the [Unload SWF], I am not doing anything to tell it to Unload my swf.
    I am using FB to do all my coding and debugging if that matters.
    Does anyone have any ideas.
    thanks,

    Apparently I was, so I changed it to classic text in my Directory.fla and that seemed to remove the weird error.  However it seem that my swf is still not loading.  any Ideas why that might be?
    [EDIT]  Ok, my Directory swf is defenatly loading. but not showing up in the display list. I updated my LoadBoard to the following.
    package com.aces
         import flash.display.Loader;
         import flash.display.MovieClip;
         import flash.events.Event;
         import flash.net.URLRequest;
         public class LoadBoard extends MovieClip
              public function LoadBoard(nameOfBoard:String)
                   var boardLoader:Loader = new Loader();
                   boardLoader.load(new URLRequest(nameOfBoard));
                   boardLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, finishLoading);
              public function finishLoading(loadEvent:Event):void
                   addChild(loadEvent.currentTarget.content);
                   trace("swf should be loaded");
    any Ideas?
    Thanks,

  • Load external swf and consume your lybrary

    dear friends flashers,
    I need to load a swf into another swf and access objects that are in the library.
    load a swf into another is not my problem the problem is to create an instance of an audio exported to action script contained in the child swf.
    Has anyone had this problem? help me?
    Thanks.
    Marcio.

    I founded by myself, I just created a movie clip of this button and here is my code in case someone has the same problem...
    import flash.events.MouseEvent;
    import flash.display.Loader;
    import flash.net.URLRequest;
    var loader:Loader = new Loader();
    loader.load(new URLRequest("MyInDesignSwf.swf"));
        addChild(loader);
              addChild(home_front);
    home_front.addEventListener(MouseEvent.CLICK,playClickedExit)
    stop();
    function playClickedExit(event:MouseEvent):void
    removeChild(loader);
    gotoAndPlay(90);

  • Loading two swfs and playing them sequentially

    Hello Team,
               I have searched, but can't seem to find an answer to my question.  I'm working in Flash cs6 on Windows platform. I do not understand how to load two external swf files into another swf file(Main swf) and have them play sequentially. I certain that this task is extremely small to a lot of members of this forum, but if someone could be so kind to assist me with this inquiry I will be over-joyed.
    I am able to load one swf with the following code:
    var swf:MovieClip;
    var loader:Loader = new Loader();
    var defaultSWF:URLRequest = new URLRequest("swf/gallery.swf");
    loader.load(defaultSWF);
    addChild(loader);

    AS3 - Dispatch Event
    Example:
    Add something to trigger the event in the child:
    dispatchEvent(new Event("eventTriggered"));
    (if dispatchEvent problem, see: http://www.kirupa.com/forum/showthread.php?p=1899603#post1899603)
    The listener for this event has to be added to the main file AFTER the external file has been loaded.  In your loading/parent swf, listen for the complete event on the Loader.contentLoaderInfo. 
    yourLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderCompleteHandler);
    In the complete event handler, add a listener for the event on the loaded swf.
    // event handler triggered when external swf is loaded
    function loaderCompleteHandler(event:Event) {
        MovieClip(event.currentTarget.content).addEventListener("eventTriggered", eventHandler);
    Then just create the event handler for the dispatched event listener that was created in the loaderCompleteHandler function.
    function eventHandler(event:Event):void {
        trace("event dispatched in loaded swf");
        // load/play your second swf now

  • Loading external swf and object error

    Hello Forum,
    I have two swf files, Flash CS3, action script 3.
    One file can be considered to be the parent container, it
    does have some objects on its stage.
    The other file is a file that I would like to load into the
    master file using the Loader object.
    The file that I would like to load, works fine (or so it
    seems) standalone. This file contains
    a timer object, a loader object (which loads images from an
    xml file), and XMLLoader feature,
    and a button that I have created from a class that i have
    created for a button. I can set the
    label for the button from the swf like a property. This swf
    is all Actionscript, using
    addchild to get the various things on the stage.
    I am using actionscript to load the objects on the stage in
    the external file - as opposed to having
    them on the timeline before hand.
    When I try to load this external swf file in to a parent swf
    file I get an error like this:
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at weekly_tasks_fla::MainTimeline/frame1()
    This error happens whenever (in the external swf file) i add
    an object
    (like a button or a textfield) to the stage of the exteranl
    swf file.
    I am able to load other swf files ok (as long as I did not
    create them!).
    Confused Again,
    eholz1

    I sat typing into the quick reply, but this isn't sorry.
    The issue here is that when you roll over another object
    within the application it assumes that you have moved out of the
    current object even if the new object is within the container of
    the current object.
    Hope that makes sense upto now. I had the same problem and
    had to do this...
    On mouse Over pr Rollover on internal object I run the stop
    propogation and then restart the mouse over of the parent
    container.
    private function stopGadget(e:MouseEvent):void
    // Stops the current mouse over running the parent container
    mouse over. Then reloads the parent container for the gadget bar
    (BIT OF A HACK)
    e.stopPropagation();
    Application.application.showTheGadget(e);
    I think my comment sums it up a BIT of a Hack.

  • How do i load a swf and take snapshots of that loaded swf?

    hey guys, so i have a multitude of swf's that i need to load into my application, and after loading them i need to take image snapshots of those swf's, to create a slides list.
    i know i can do somehting like this:
    var imageSnap:ImageSnapshot = ImageSnapshot.captureImage(source);
    but the problem is, how do i know if the swf has loaded all the data within it???
    thanks in advance!

    OK.
    Here is the starting point:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
       xmlns:s="library://ns.adobe.com/flex/spark"
       xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
    <fx:Script>
    <![CDATA[
    import mx.controls.SWFLoader;
    private var swfLdr:SWFLoader;
    private function startSWF():void
    swfLdr = new SWFLoader();
    swfLdr.horizontalCenter = 0;
    swfLdr.verticalCenter = 0;
    swfLdr.source = "youFile.swf";
    addElement(swfLdr);
    ]]>
    </fx:Script>
    <s:Button x="50" y="50" label="start" click="startSWF()" />
    </s:Application>
    If this code gives you an error, you want to check that the swf address is correct and the swf itself is not corrupted.
    From that point,  you start build your custom functionality - one step at a time!
    Sorry, HTH,
    FTQuest

  • How can i load a swf AND connect to a network location?

    I'm working on a fairly large framework application that
    consists of a large number of seperate files (swfs, stylesheets,
    xml etc etc) all being loaded in and then connecting to a remote
    server.
    My problem is that when i compile all my library swfs with
    -use-network=false all is well - until i try a
    NetConnection.connect() call, when i get told i can't connect to an
    internet url from a local-with-filesystem swf.
    Ok, so i created a .cfg file and placed it in the
    FlashPlayerTrust directory, indicating that i'm giving permission
    for everything in my 'deploy' directory to be trusted - which
    should allow it to do anything it like (load files AND connect to
    the network). But after doing that i no longer get any sandbox but
    my NetStatusEvent is never fired! I receive neither a success or
    failure message from the NetConnection... it just sits there and
    nothing happens...
    Can anyone point me in the right direction, there seems to be
    precious little information about situations like this, just a lot
    of people asking similar questions...
    Thanks
    T

    like i said in the original post the framework is a series of
    libraries, they're loaded at runtime depending on what's required.
    if i have the netconnection in a single swf it'll work in the
    standalone player or in IE or FF.... it'll work if i launch it
    locally and connect to a remote server, or when i put it on the
    server and access it through a browser.
    it's when it goes into one of the libraries that it fails -
    so a base swf loads a configuration file which tells it which
    libraries it'll need, one of those libraries contains the
    netconnection code - and the NetStatusEvent of the NetConnection is
    never fired - so i neither succeed nor fail in my connection
    attempt
    T

  • How to load external swf and handle events of external swf by passing data .

    Hi all
    I have to laoad external swf (made in flash).On loading i have to pass data and hndle events which occurs on this swf.
    Can any one suggest me how can I achieve this.
    Regards
    Munira

    Here is one way:
    http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7f9c.html
    HTH,

  • Loading external swf and Roll_OVER ROLL_OUT Events...

    Hi.
    Suppose the following scenario:
    My application has some handlers attached for the rollover
    and rollout events. the seem to work pretty fine. But i have to add
    into my application an swf, so i add it using an Image Object. This
    new Image Object containing my external swf file is into my
    application. Now Roll_OUT event of my application fires when i
    enter the swf Image Object, that is inside my application!!!
    What am i doing wrong? I attach an example
    Maybe that swf has events on it...
    I am really confused about this behaviour in flex

    I sat typing into the quick reply, but this isn't sorry.
    The issue here is that when you roll over another object
    within the application it assumes that you have moved out of the
    current object even if the new object is within the container of
    the current object.
    Hope that makes sense upto now. I had the same problem and
    had to do this...
    On mouse Over pr Rollover on internal object I run the stop
    propogation and then restart the mouse over of the parent
    container.
    private function stopGadget(e:MouseEvent):void
    // Stops the current mouse over running the parent container
    mouse over. Then reloads the parent container for the gadget bar
    (BIT OF A HACK)
    e.stopPropagation();
    Application.application.showTheGadget(e);
    I think my comment sums it up a BIT of a Hack.

  • Loading an external clip(swf) and removing existing one

    Hi All,
    I am tearing my hair out; I simply want a button when
    clicked, to load an external swf. But I just can't seem to get my
    head around it. Here is my code:
    butt1_btn.addEventListener(MouseEvent.CLICK, swf1);
    function swf1(evt:MouseEvent):void
    loadSwf1.load(new URLRequest("swf1.swf") );
    butt1_btn.buttonMode = true;
    Any help with this would be much appreciated!
    Kind Regards,
    Boxing Boom

    Hi,
    Sorry for late response. I used the following code, which
    loads another swf and replaces the original swf;
    computerProtection_btn.addEventListener(MouseEvent.CLICK,
    removeMain, false, 0, true);
    var ld:Loader = new Loader();
    ld.load(new URLRequest("computerProtection.swf"))
    function removeMain(evt:MouseEvent):void {
    this.parent.addChild(ld);
    this.parent.removeChild(this);
    Now, the problem is that when I use the same code to get back
    to the original, it doesn't work. Obviously, I have changes the
    button name and the requested swf.
    I get an error stating something about the main timeline.
    Funny, how it works only once, loads a swf but won't load another
    swf file.
    I appreciate the time this issue has taken. But an answer
    would be nice!
    Kind Regards,
    Boxing Boom

Maybe you are looking for

  • Is verizon screwing with me ?

    so ive been having internet problems on and off since ive had the service for the past 4 years, finally work out all the kinks and get things squared away and now it feels like they are intentionally messing with me... so heres what happened for abou

  • Printing from javascript

    i want to devolop a site on that there should be facility for printing and downloading files. what are the requirements in javascript

  • Styleddocument problem with styling text

    Hello, I am looking to create syntax highlighting for a document. First I am just getting to grips with how it all works. I have reached a problem I hope someone will be able to help me understand.. The following is the code where I have the problem.

  • Limit SC creates item category as 0 (blank) but PO not created indeed

    Hi All I create limit sc to get limit PO in the ECC.. error  net price is greater than zero while creating purchase order . Shopping cart item_type = LIMI SHOULD determine the item category in the backend? How can i find out who is making item catego

  • Creative Cloud 30 Trial.

    I downloaded it more than a month ago but didn't use it.  Do I get another trial for an Adobe Educator course i'm taking?