Load swf AFTER playing to end of root timeline

Don't know if this can be done or not...
I have my Home page - 5 Navigation buttons on the page. Each
button "onRelease" will load an external swf file ( a new page).
The problem i'm having is getting the the buttons to play the rest
of the root timeline (after "Stop) before it loads the external
swf. The rest of the timeline is just a short fade to Alpha 0 of
all buttons before the new page comes in.
any help?
thanks in advance.

michaeltowse wrote:
> Could you not assign a variable which is then picked up
at the end of the main
> timeline. This variable could be used within a loadMovie
command. Your buttons
> would have the variable declaration and then a play()
command.
>
What you seem to need is some sort of non unloading loading
of the movie.
You got the level loading method, the movieclip loading
method and the
dedicated loader class.

Similar Messages

  • Load swf and play movieclip inside it

    I want to load  a swf and play a moveclip inside it, but the SWFLoad.content always is null. Does sombody know how to resolve this problem?
      private var SWFLoader:Loader;
      public function myApp3()
       SWFLoader = new Loader();
       var request:URLRequest = new URLRequest("FlashAS3_2Flex.swf");
       SWFLoader.load(request);
       this.addChild(SWFLoader);
       var currentSWF = MovieClip(SWFLoader.content);//SWFLoader.content is null
       currentSWF.myClip.gotoAndPlay(1);

    The code you show works fine for me.  How is btn1 created/named in the second swf file?  If you create it dynamically and do not assign a name property to it, it does not have the name you think it does.

  • Sound objects in loaded swfs not playing

    I'm working in ActionScript 2.  I have a series of swfs with Sound objects.  Works just fine when I play the swf.  However, when I load them into a loader, no sound.  HELP!!!

    when you instantiate your sound, instead of using something like:
    var s:Sound=new Sound()
    use
    var s:Sound=new Sount(this);

  • Control loaded SWF after loadClip() in F9

    Flash IDE version: 9
    Flash player version: 9
    Using ActionScript 2.0
    I am rewriting some old MX code that typically loads a
    graphics-only SWF with several frames. Then I boss the SWF around
    using loadedSWF.gotoAndStop(), but now that breaks unless I compile
    as Flash 7 / AS2. To keep it reasonably current I hope to get this
    working in a higher version. We have darn near a jillion of these
    graphics SWFs and are in no mood to open them all up. If this has
    already been extensively discussed please help me with a pointer to
    the juiciest parts!
    Regards,
    Bestobell

    Hello, thank you very much for your reply (and apologies for
    my slow acknowledgement). The problem has been very peculiar as it
    affects some environments but not others, but your reply suggests I
    should look at clumsy mistakes first. I had suspected - 1. some
    security problem - 2. flash 9 discouraging too much rummaging
    about.
    In Flash IDE - works
    On my desktop in standalone player - fails
    etc. etc.

  • Determining next button after play has ended

    I've created a DVD project with two menu pages, each with 10 buttons on it. After a selection has played, it always returns to the first menu and first button. Where do I set it so that, if I am watching something from 'menu 2', it stays on menu 2 and after the button has finished, the cursor moves to the next button?
    Thanks,
    Anthony

    Anthony
    You'll find all you need in this excellent scripting tutorial: * GPRM based button jumps * (Thanks Hal!).
    Hope that helps !
      Alberto

  • Loaded swf with button , not communicating to main timeline

    my main stage/timeline has a UILoader "UILoaderOne" and
    another one "UIloaderTwo".
    i have some buttons on the main stage which pull up some
    images into the UILoaderOne.
    these work fine and look like this.
    //BEGIN BUTTONCODE\\
    //button to load image into loader "loaderOne" x01_btn and
    x01_ldr, thumb image is "x01.jpg and main image is p01.jpg\\
    //crop thumb image to size 50px tall by whatever wide and
    resize loaderButton if needed, main image will resize
    proportionatly\\
    x01_btn.addEventListener(MouseEvent.CLICK, onClick);
    function onClick(event:MouseEvent):void
    //import fl.containers.UILoader;
    import fl.controls.Label;
    import fl.controls.ProgressBar;
    var url:String = "assets/01.jpg";
    //var myUILoader:UILoader //= new UILoader();
    myUILoader.unload();
    myUILoader.autoLoad = false;
    myUILoader.source = url;
    //myUILoader.move(10, 10);
    myUILoader.scaleContent = true;
    myUILoader.load();
    var myProgressBar:ProgressBar = new ProgressBar();
    myProgressBar.source = myUILoader;
    myProgressBar.setSize(100, 10);
    myProgressBar.move(myUILoader.x+340, myUILoader.y+250)
    myProgressBar.addEventListener(ProgressEvent.PROGRESS,
    progressHandler);
    myProgressBar.addEventListener(Event.COMPLETE,
    completeHandler);
    addChild(myProgressBar)
    var myLabel:Label = new Label();
    myLabel.text = ". . . . . X . . . . . ";
    myLabel.autoSize = TextFieldAutoSize.LEFT;
    myLabel.move(myProgressBar.x, myProgressBar.y +
    myProgressBar.height);
    addChild(myLabel);
    function progressHandler(event:ProgressEvent):void {
    //trace("progress:", event.bytesLoaded, event.bytesTotal,
    int(event.currentTarget.percentComplete) + "%");
    //myLabel.text = event.bytesLoaded + " of " +
    event.bytesTotal + " bytes loaded.";
    myLabel.text = ("progress:", event.bytesLoaded,
    event.bytesTotal, int(event.currentTarget.percentComplete) + "%")
    //myLabel.text =
    Math.round((event.bytesLoaded/event.bytesTotal)*100) +"%";
    function completeHandler(event:Event):void {
    trace("complete:");
    myProgressBar.removeEventListener(ProgressEvent.PROGRESS,
    progressHandler);
    myProgressBar.removeEventListener(Event.COMPLETE,
    completeHandler);
    removeChild(myProgressBar);
    removeChild(myLabel);
    //addChild(myUILoader);
    //trace("typeMe");
    //end BUTTONCODE\\
    //end BUTTONCODE\\
    the second Loader "UILoaderTwo" auto loads another swf file
    with the INTENT to load from buttons, images into the ULLoader
    "UILoaderOne" which is on the main timeline.
    this part is failing
    the error i get in Output window is
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at sOne_fla::MainTimeline/onClickz()
    the swf that loads is sOne.swf
    and it has code of this
    z01_btn.addEventListener(MouseEvent.CLICK, onClickz);
    function onClickz(event:MouseEvent):void
    import fl.containers.UILoader;
    import fl.controls.Label;
    import fl.controls.ProgressBar;
    var url:String = "assets/xx.jpg";
    var myUILoader:UILoader //= new UILoader();
    myUILoader.unload();
    myUILoader.autoLoad = false;
    myUILoader.source = url;
    //myUILoader.move(10, 10);
    myUILoader.scaleContent = true;
    myUILoader.load();
    var myProgressBar:ProgressBar = new ProgressBar();
    myProgressBar.source = myUILoader;
    myProgressBar.setSize(100, 10);
    myProgressBar.move(myUILoader.x+340, myUILoader.y+250)
    myProgressBar.addEventListener(ProgressEvent.PROGRESS,
    progressHandler);
    myProgressBar.addEventListener(Event.COMPLETE,
    completeHandler);
    addChild(myProgressBar)
    var myLabel:Label = new Label();
    myLabel.text = ". . . . . X . . . . . ";
    myLabel.autoSize = TextFieldAutoSize.LEFT;
    myLabel.move(myProgressBar.x, myProgressBar.y +
    myProgressBar.height);
    addChild(myLabel);
    function progressHandler(event:ProgressEvent):void {
    //trace("progress:", event.bytesLoaded, event.bytesTotal,
    int(event.currentTarget.percentComplete) + "%");
    //myLabel.text = event.bytesLoaded + " of " +
    event.bytesTotal + " bytes loaded.";
    myLabel.text = ("progress:", event.bytesLoaded,
    event.bytesTotal, int(event.currentTarget.percentComplete) + "%")
    //myLabel.text =
    Math.round((event.bytesLoaded/event.bytesTotal)*100) +"%";
    function completeHandler(event:Event):void {
    trace("complete:");
    myProgressBar.removeEventListener(ProgressEvent.PROGRESS,
    progressHandler);
    myProgressBar.removeEventListener(Event.COMPLETE,
    completeHandler);
    removeChild(myProgressBar);
    removeChild(myLabel);
    //addChild(myUILoader);
    //trace("typeMe");
    //end BUTTONCODE\\
    //end BUTTONCODE\\

    well, I'm such a novice to begin with.
    the loader is actually placed on stage manually, and instance
    named manually so a lot of that code is may not be needed,
    i do a lot of trial and error technique
    it is all personal stuff
    one guess i have is to set up a listner as to when the sOne
    is loaded, and then get a way to communicate to each other?
    how?

  • Can you tell when a loaded SWF has reached its final frame?

    I used loadMovie to load an external SWF into the bottom-half
    of a main "shell" swf. When that loaded SWF finishes playing (it's
    just an animation), I need to populate a text field with the word
    "DONE" . The text field resides on the _root, so I need some way to
    know when the loaded SWF has reached its last frame...
    This would obviously be easy if I had the .FLA of the loaded
    SWF because I could just write the actionscript on the last frame
    of that SWF to populate the _root textfield. Alas, I do not have
    the source FLA of that loaded SWF, so I need some way to have the
    main "shell" SWF/FLA know when that loaded SWF has reached its end.
    Is this possible???
    Thanks!!!

    DIY_Lobotomy,
    > The reality of my situation is that there's a "menu" of
    sorts that
    > gets loaded into "contentClip". This "menu" has a bunch
    of links.
    So far, so good.
    > When clicked, each link loads a DIFFERENT swf into
    "contentClip".
    > It is THOSE swfs that I need to note the end of.
    That's still okay.
    > So, there's actually more than one, and they're not
    exactly being
    > loaded directly from my main movie, since they're
    actually loaded
    > based on a link being clicked in the movie that is
    currently loaded
    > into "containerClip"
    The concept is still the same, no matter what. No matter how
    deep the
    one-clip-loads-another chain goes, you have to keep taps on
    each chain link.
    When the final link has loaded, you'll be able to make your
    object reference
    to that movie clip. That movie clip -- because it's an
    instance of the
    MovieClip class -- will have the _currentframe and
    _totalframes properties.
    You'll just be checking *that* cliip's properties instead of
    the one named
    contentClip in my own example.
    You can loop using onEnterFrame or, if you prefer, with
    setInterva().
    That doesn't much matter either, so long as you repeatedly
    poll the deepest
    clip to test its current frame against its last frame (this
    all assumes that
    the clip being tested is a linear animation whose end
    corresponds to its
    last frame; otherwise, you could check _currentframe against
    any arbitrary
    frame number).
    > I hope that wasn't too confusing! Do you still have a
    solution???
    Not too confusing to understand, but it might be confusing
    to route
    through in practice. Not confusing, actually, but meticulous
    ... you'll
    have to be careful with your pathing. Nested movie clips are
    very much like
    nested folders on your hard drive. Their instance names
    relate to the
    folder names.
    Now, if that menu doesn't have an instance name you provided
    -- or if
    any fork along the path has an instance name you can't
    control -- you can
    still reference the nested movie clips. If you test your file
    in the
    Debugger panel, you'll see all the instances laid out in
    hierarchical order.
    You'll see that automatic instance names are provided
    (something like
    "instance1", "instance2", etc.).
    David Stiller
    Contributor, How to Cheat in Flash CS3
    http://tinyurl.com/2cp6na
    "Luck is the residue of good design."

  • Loading swf into container

    I have created a movie that loads several swfs through an
    empty container. I have tried changing file paths numerous times
    and I can't get the movies to play correctly. Actually, they did on
    our local testing server, but after uploading to the clients
    server, the problems began.
    My test page is:
    http://www.sumnerhomemortgage.com/test/index.html
    loader.swf initially plays part1.swf. Here is the code for
    that:
    loadMovie("
    http://www.sumnerhomemortgage.com/test/flash/part1.swf",
    container);

    Did you upload the FLV to the correct place?
    I downloaded part1.swf, opened it in Flash, and got the
    following error:
    Error opening URL '
    http://www.sumnerhomemortgage.com/test/flash/part1.flv'
    If I paste that URL into the browser I get a 404. I also
    tried it in:
    http://www.sumnerhomemortgage.com/test/part1.flv
    http://www.sumnerhomemortgage.com/part1.flv
    and got a 404 for all of them

  • Pass parameters to a function in main class from loaded SWF?

    I've got a main.as that loads SWF to the stage.
    the loaded SWF seppoused to pass a link to the main.as and trigger a javascript function to popUp that photo from that link.
    I know there are two ways:
    ((root as MovieClip).parent.parent as Object).somefunction(parameters);
    and to dispatch an event.
    inorder to pass parameters throug the event i need to extend it with another class.
    isnt the (root as... )  more efficient if all i need is to pass a link?

    when a photo from the gallery is selected a javascript popUp shows it enlarged with additioan editing options (kinda like in facebook).
    in that popUp ther is also a next button so its kinda bidirectional. (the next calling the loaded SWF throug main to get the next link in the photo array)
    the photo is a grandchild of a grandchild of the stage and the loaded swf is a grandchild so using:
    ((root as MovieClip).root as MovieClip).ExternalInterface.call("ShowPic", link);
    is discusting ><

  • Load one swf after another?

    Hey!
    I've created a presentation in Flash that exceeds the maximum number of frames. I broke it up into a few different files, and now I need these .swfs to load one after another automatically, without prompting or clicking anything on the screen.
    The presentation is for an interpretation program at work and will be played for an audience several times a day. It was originally a 6-slide-projector presentation that I simplified, and this is the last step to replacing the old projection system altogether.
    Does anyone know how to solve my problem, as simply as possible?
    Thank you!

    you'll probably want to load them all at the start of you presentation so they're ready for display without waiting.
    so, use standard preloader code to load your swfs.  use a loop or dispatch an event to detect when one ends and another needs to start.

  • Flash loader reappears after movie plays

    i am new to flash and cannot figure this out!!! it's probably
    super simple... i have created a loader with progress bar and it
    seems to work fine, but after my movie finishes playing the loader
    screen with progress bar reappears at the end. how can i make it go
    away? here's the actionscript i have so far:
    loader.contentPath = "ice.worlds.2.swf";
    loader.autoLoad = false;
    pbar.setStyle("themeColor", "0x00AEEF");
    pbar.setStyle("color", "0xCCCCCC");
    pbar.setStyle("fontFamily", "verdana");
    pbar.setStyle("fontSize", 10);
    pbar.source = loader;
    pbar.mode = "polled";
    thanks in advance for your help!

    i tried what was suggested below, but it didn't work. do i
    need to put anything in the parentheses and if so what? i tried
    leaving it as is and i also tried putting the name of the loader
    file in: "iceworlds.loader.swf"
    thanks!

  • How to detect the end of a loaded swf file

    Hello Guys
    This is my first time on this forum, come here with a great
    hope
    I have loaded a picture file (jpeg) and a video file (swf)
    into the main flash file using xml
    on frame 3, I load the picture and on frame 7, I load the
    video, there is a stop action on frame 6
    Now when the flash is executed the picture is displayed ( it
    says "Click here to view the video")
    when the user click the picture , the video is loaded and
    starts to play ---- so far everything is working fine
    now what I want to do is, once the video finishes playing (
    not stoped) I want to display the picture again
    can you tell me how to detect the end of an external loaded
    swf files,
    Please help me
    Thanking You
    Shriram

  • 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

  • Can an AS1/2 swf loaded via Loader class tell the main movie (AS3) that it has run to the end of its timeline?

    If I load an external swf:
    my_loader.load(new URLRequest("abc.swf"));
    addChild(my_loader);
    abc.swf starts playing - how do I get it to tell the main movie that it reached the end of its timeline and finished playing?  Added bonus: the loaded swf is AS1 and the main movie is AS3.  I'm not sure if I could convert the loaded swf to AS3.
    Thanks,
    Sean

    I have not used this component but it may work for you:
    http://www.jumpeyecomponents.com/Flash-Components/Various/ActionScript-Bridge-91/

  • Manipulate SWF after loading with HTML img through XML

    I am using XML and HTML to load a SWF file into a TextArea.  The SWF is displayed at runtime but doesn't work.  I'm assuming it is due to _root conflict.  I want to set _lockroot=true on the SWF thinking that it will use it's own root timeline. But my question is how to access it?  How to get it's ID path when loaded this way.  And secondly will _lockroot do it or is there some other way to get it to work as an embedded SWF object? 

    Thanks. So I'll need the Flash source file to apply lockroot  - or I would need to open the SWF in a pop up HTML page if no source is available.  (or use a decompiler to add the code to the SWF ?)

Maybe you are looking for