A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: loading external movies into layer 1 on load

  1. #1
    Member
    Join Date
    Jul 2003
    Location
    Kentucky
    Posts
    46

    loading external movies into layer 1 on load

    I have a movie that i load other movies into or onto. Main movie is layer 0 and all others are loaded on layer 1.

    when layer 0 starts I want one of these external files to load automaticly on load up of layer one.

    Any ideas how to do that?

    To get an idea what im doing go to http://www.devilsarmada.com

    thanks in advance
    Use no way as way and no limitation as limitation.

    "Bruce Lee"

  2. #2
    Senior Member
    Join Date
    Oct 2004
    Location
    Rio de Janeiro, Brazil
    Posts
    344
    On the very first frame of the main movie, code:
    Code:
    if (FlagFirstTime == undefined)
    {
       loadMovieNum ("external.swf",1);
       FlagFirstTime = true;
    }

  3. #3
    Member
    Join Date
    Jul 2003
    Location
    Kentucky
    Posts
    46

    Thanks

    Thank you very much. I've been learning actionscript slowly but surely.
    Use no way as way and no limitation as limitation.

    "Bruce Lee"

  4. #4
    Senior Member
    Join Date
    Apr 2002
    Posts
    178
    after this movie is loaded how do you reach the attributes like changing _x and _y ?
    gr verner

  5. #5
    Junior Member
    Join Date
    Sep 2005
    Posts
    16
    put an empty movie clip on layer 1, name it, and use

    movieClipName.loadMovie("external.swf")

    then you can access it by movieClipName._x or movieClipName._y
    -VC

  6. #6
    Senior Member
    Join Date
    Apr 2002
    Posts
    178
    will this be _level5 ?
    gr verner

  7. #7
    Senior Member
    Join Date
    Apr 2002
    Posts
    178
    mmm i need to load the movie in 5 using the loadmovienum and then set the x and y.

    i am restricted to using flah player 6 and earlier

    movieClipName.loadMovieNum("external.swf",5);
    Last edited by gverner; 09-08-2005 at 07:03 AM.
    gr verner

  8. #8
    Member
    Join Date
    Jul 2003
    Location
    Kentucky
    Posts
    46

    More Help

    if (FlagFirstTime == undefined)
    {
    loadMovieNum ("external.swf",1);
    FlagFirstTime = true;
    }

    this worked for me greatly but out of curiosity, is there a way to make it time delayed so that it does not load immediatle?
    Use no way as way and no limitation as limitation.

    "Bruce Lee"

  9. #9
    Beyond the Sea
    Join Date
    Mar 2000
    Posts
    997
    if you load a movie into a level, you have no control over its attributes like _x, _y, _xscale, etc. A better way is to create an empty movieclip on the stage, then you can load your external movies into that, one at a time, or you can create an empty movieclip for each of the external clips and load from there.

    Now, let's say you create an MC on the stage called a_mc:
    this.createEmptyMovieClip("a_mc",20);

    Then, you want to load an external clip into it, but you don't want it to show up on the stage yet, so you move that clip way off the stage so it won't show up until you move it back into position:
    a_mc._x = -800;
    a_mc._y = -600;
    a_mc.loadMovie("external_0.swf");

    Finally, after it's loaded and you're ready for it, you put it back into position and tell it to start playing at the beginning:
    a_mc._x = 0;
    a_mc._y = 0;
    a_mc.gotoAndPlay(1);

    For further study, look up the MovieClipLoader class in the flash help. It's a nice, built-in class that allows you to specify a bunch of things to load and functions that will run when each one is complete, or as each one is progressing.
    The Coolest Website EVER!
    Do you live in Kansas City? Come join us at KCWebCore

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center