Issue of SWF and movieclip

In my index.swf, I have a movieclip, content_mc which contains a menu movieclip, portMainButtons_mc.

index.swf load portfolio.swf in a UILoader, sectionLoader. When portfolio.swf has completed an animation, I want to say portMainButtons_mc in index.swf to gotoAndPlay (2).

I tried this at the end of the animation of portfolio.swf:

var mainMovie:Object is this. DisplayObject.parent;

mainMovie.content_mc.portMainButtons_mc.gotoAndPlay (2);

Stop();

and that did not work.

I read that the use of "parent" is not the best thing to do.

In fact, the error could be related to use: this. DisplayObject.parent... the correct way to write which would have been... DisplayObject (parent)... and 'that' is not often necessary in AS3

I will try to help him, using some hear - say I've heard said since then I have not much chance to experiment with it.  In case of failure I'll direct you to the publication of the pre-hear-say...

Example:

Add something to raise the event at the end of the loaded swf file:

dispatchEvent (new Event ("donePlaying", true));

In your SWF to loading/parent, listen for the complete event on the UILoader.  In the complete event handler, add a listener for the event.

sectionLoader.addEventListener (Event.COMPLETE, loaderComplete);   // *****

triggered when external swf loading event handler / / *.
function loaderComplete(event:Event) {/ / *}
stage.addEventListener ("donePlaying", doneHandler);
}                                    // *****

function doneHandler(event:Event):void {}
your code here... content_mc.portMainButtons_mc.gotoAndPlay (2);
}

The main difference in what I'm showing compared to the announcement, that I refer also is that the listener for events donePlaying of your swf file is assigned to the scene in this case instead of the object that was loaded.  The 'real' in the function dispatchEvent call is indicative of the event to bubble as it can be heard beyond the object.

In this case, I don't know that you have to wait to assign the listener for the donePlaying event, then you can try jump seen the listener/handler for the UILoader and see if it plays.  In other words, you won't have the lines that I marked with "/ / *"

Tags: Adobe Animate

Similar Questions

  • Loading multiple SWFs and saving them (code works is not under Chrome and Firefox 23)

    Hey guys,.

    Anyone has an idea why this suddenly does not work? (It works under internet explore but not firefox and chrome)

    The code below is placed on my main swf to preload all my external swf and store them for not having to wait too long to get there.

    Thank you guys.

    I took the code by btw: http://www.beautifycode.com/the-finer-art-of-loading-2-handling-multiple-swfs#snippet

    I am running flash player 11.8.800.94... He 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 {}



    //

    }

    };

    I have no problem with ff and I don't see any problem in chrome.

    You probably have a typo in if:

    loadSWF(pathArr[1]);

    should be

    loadSWF(pathArr[0]);

  • Why several versions of swf and which one to use?

    First of all, thank you for your wisdom and your experience of sharing. I learned so much from browsing your qustions and answers.

    I completed the review of all the different threads associated with several full motion.swfs created by publishing a .cp as swf file. I am absolutely amazed that the process is so difficult. Honestly, the help doc made it sound like "just insert the file swf and go! No mention of this mess.

    If I would have known I would not have recommended the purchase. But, here it is, then what are you doing?

    My issues desperate, outside of what am I doing wrong, are 1) outside the copy of all FM, sovereign wealth funds in the folder data\resources (not an option) is possible to consolidate all SWFs in a single swf file?

    Desperately yours.

    Rob

    LOL, I think you're just overthinking it.

    When you publish the temporary folder it created SWF, right?

    Thus, on the empty slides, you just need to click on them to open them in the editor of Captivate.

    Then click on Insert > Animation and head toward them.

    See you soon... Rick

    Useful and practical links

  • Firefox should display files .swf and .flv without Adobe. You can do it can't you?

    If the "Media Player Classic" program can read files .swf and .flv, programmers probably Firefox can do for those that did for .pdf files. PLEASE, I BEG YOU!

    Hello, mozilla is indeed working on it, but it is not an easy task...

    https://blog.Mozilla.org/research/2012/11/12/introducing-the-Shumway-open-SWF-runtime-project/

  • This is where other issues of quality and quality Plans are grown?

    This is where other issues of quality and quality Plans are grown?

    Ben

    As the quality is part of discrete manufacturing module that seems logical, but you might also find some useful discussion for the purchase or manufacturing process.

    JS.

  • the .swf and .html files does not work while the .fla file works great

    Hi I'm new to actionscript, and I have a question. The fla file works perfectly and runs the timer function and reads the xml file to create an RSS feed, but when I publish and choose HTML wrapper and then choose 14 Flash swf and html file load the photos and the text field but isn't something else please help.

    Thanks in advance.

    import flash.net.URLLoader;

    import flash.net.URLRequest;

    import flash.events.Event;

    import flash.text.TextField;

    import flash.text. *;

    import flash.utils.Timer;

    import flash.events.TimerEvent;

    var RSSLoader:URLLoader = new URLLoader();

    var RSSURL:URLRequest = new URLRequest ("http://sports.yahoo.com/soccer//rss.xml");

    RSSLoader.addEventListener (Event.COMPLETE, RSSLoaded);

    RSSLoader.load (RSSURL);

    var RSSXML:XML = new XML();

    RSSXML.ignoreWhitespace = true;

    var title: TextField;

    var desc:TextField;

    var allText:TextField;

    title = new TextField();

    allText = new TextField();

    var i: int;

    function RSSLoaded(e:Event):void {}

    trace ("xml load file here");

    RSSXML = XML (RSSLoader.data);

    for {(var selectedItems:String in RSSXML.channel.item)

    title. Text = (RSSXML.channel.item [selectedItems] .title + "/");

    title.wordWrap = true;

    tfLog.text += title.text;

    tfLog.wordWrap = true;

    trace (title. (Text);

    }

    }

    var t:Timer = new Timer (200);

    t.addEventListener)

    TimerEvent.TIMER,

    function(EV:TimerEvent): void

    {

    tfLog.text tfLog.text.substr = (1) + tfLog.text.charAt (0);

    }

    );

    t.Start ();

    var picTimer:Timer = new Timer (2000);

    picTimer.start ();

    picTimer.addEventListener (TimerEvent.TIMER, timehandler);

    function timehandler(event:TimerEvent):void {}

    setChildIndex (getChildAt (7), 0);

    }

    A way around that is to have a PHP file on your server that reads the XML feed and your swf reads the data from the PHP file rather than directly from the external domain.

  • Load external .swf and button top

    Hello!

    I have a problem here! I want to load a file (created from inDesign) external .swf and then on load a button at home (a small image that I created with the name "home_btn"), which refers to my home page to say frame 90

    Any help it would be greatly appreciated,

    Frank

    I founded by myself, I just create a clip of this button and this is my code in case anyone 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);

    }

  • Difference between addChild and movieclip internal

    Hi all

    What is the difference bettween addChild and the movieclip that is in the movieclip.

    We can get these getChildAt() instance but

    According to the internal movieclip, we can get instance of 'mc.mcInternal '.

    But when I addChild in 'mc' is impossible to get this instance of this method 'mc.mcInternal '.

    What is the diffecenct between internal addChild and movieclip.

    Thanks in advance

    flashgeeks.

    Thanks Peter,.

    Once again, but it is possible to get the movieclip that is create from addChild(), normally access like this "mc.mcInternal".

    Not this way:

    mc.mcInternal = new Movieclip();

    mc.addChild (mcInternal);

    can I access this movieclip.

    trace (MC.mcInternal);

    Thank you very much

    theflashgeeks

  • Problem with the publication of a swf and html in CS5 file

    Hey, I'm a newbee in flash. I use Flsh cs5. I created a simple .fla file. But when I publish, .swf and .html file are not created in the folder.

    And when I test the movie (control-> test movie), it does not open any window to display the flash.

    Help, please.

    Click on file/publish/formats settings, make sure that the swf and html boxes are selected, and click the button use default namespace.  then click on file/publish.  are the files in your directory with your fla?

    Otherwise, create a new directory (which has no subdirectory), save your fla to this new directory using a new name (it is, click File/Save as).  then click on file/publish.  see the new directory for your 3 files.

  • Difference between Sprite and MovieClip...

    Hi guys,.

    Please can you tell me what is the difference between Sprite and MovieClip?

    Thank you

    JaxNa

    1. a movieclip is a leprechaun on steroids.

    2. a movieclip has a timeline, a sprite does not work.  who has major implications on the properties, methods, and events including a movieclip and a sprite does not.

    3. the movieclip class is dynamic (that is to say, you can add properties), the sprite class is not.

  • How to use the swf and pictures as a hypertext link to specific slides when you click

    How to use swf and images as a link hypertext to specific slides when clicked.i average as a buttons.

    Hello

    The key is that you can not!

    What you * CAN * do, however, is to create the illusion that they establish between these objects. What you do is use a box click object which has been placed on top or in front of the Image or SWF file.

    See you soon... Rick

    Useful and practical links

    Captivate wish form/Bug report form

    Certified Adobe Captivate training

    SorcerStone blog

    Captivate eBooks

  • Pls see SWF and help with Actionscript

    I'm trying to get my nails of the thumb (which is the individual buttons) to display in the box to the right when you click on it, but I don't know the code to put on the buttons for that to happen. Can someone help me please.

    http://www.geocities.com/demetriusmcclain/

    Here are your files in this way, they should be programmed. There is a minor change in your file main eoa.fla (with the path to elephants.swf) and major changes to elephant.fla:

    www.geocities.com/kglad99/eoArts.zip

  • The call following .swf and close the previous?

    Hi guys,.

    I have a great difficulty using the loadMovie command.

    I want to do a book and at the end of each chapter, the next button will appoint at the next .swf, but the previous should disappear.

    For the moment, I created an empty movieclip named "load" in all .flv files... It stands for the whole time. But when I go to the next swf, it loads above the previous file, accumulating files one above the other.

    Here is the AS what I use in the last picture of my flv:

    Stop();

    next_btn.onRelease = function() {}

    loadMovie ("next_file.swf", load);

    }

    prev_btn.onRelease = function() {}

    gotoAndStop (previous_page_frame)

    };

    Then. all I want to do is create a sequence: 1 2 hits and close file 1

    .. and have the opportunity to return to the previous file, when I want to: in the first image of file 2, the back button will appoint file 1.

    Any ideas? Thank you very much

    You should have a main swf that takes care of everyone else, including your first chapter.

    but, if you want to do it your way, you can use in the main scenario for each swf:

    this.loadMovie ("nextswf.swf"); this.loadMovie ("prevswf.swf")

  • Load external swf and stopping on the 1st frame.

    Hello everyone

    I use following code to display an external swf file on the iPad.

    var request: URLRequest = new URLRequest ("http://< server ip > / test.swf");

    loader = new Loader();

    Loader.Load (request);

    The file load passes through each image and closes the application.

    Y at - it will be a way to stop the 1st frame once the file is loaded and move between the ribs to the?

    Thank you

    If you listen to when the charger is finished, you can stop the swf file:

    var mc:MovieClip;

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

    function swfloaded(e:Event) {}

    MC = e.target.content as MovieClip;

    MC. Stop();

    }

    Now you can do what you like in this clip. As:

    mc.gotoAndStop ('some ' label');

    or:

    mc.gotoAndStop (10);

  • [HELP] External SWF with Movieclip Preloader included

    Hello world

    I have a problem headaching me throughout the afternoon:

    Inside of a SWF I want to load an external SWF inside an empty movieclip. On this image, I have:


    emptymovieclip.loadMovie ("external.swf");

    Inside the external SWF, I have a Preloader in the first image, consisting of a movieclip to 128frames. I want to appear from the first image to the 128th associated percentage of loading. When loaded, go to fram 2 and this is the script on the movieclip:

    onClipEvent (load)
    {
       
    total = this.getBytesTotal();
    }
    onClipEvent (enterFrame)
    {
       
    loaded = this.getBytesLoaded();
       
    percent = int(loaded / total * 128);
       
    text = "Loaded " + percent + "%";
       
    gotoAndStop(percent);
        if (
    loaded == total)
        {
           
    this.gotoAndStop(2);
        }

    }

    Needless to say that it does not and that is why I am asking your help.

    All stops on the first frame of the Preloader.

    I'm a noob to bit for script-stuff that I'm not a programmer, I'm sorry...

    HEEEEEELP!

    If you put

    _lockroot = true;

    in the main timeline of the external swf file, it refers to its own _root whenever you use a reference to _root in its code.  Otherwise, it refers to the _root of the main file that loads the swf file.  If it works with _root when you perform the external file separately, and so it should wotk if you add this line.

Maybe you are looking for