Welcome to WebDesignForums.net!
You're currently viewing WDF as a guest. By registering for a free account, you'll be able to participate with other members in our friendly community. Being a member allows you to ask questions and get answers for those troublesome web development tasks!

In addition, as a member you'll be able to post your websites up for review. Using our unique website review system you can gain some amazing feedback from some of the best web developers around. This is a completely free service to all registered members.

Ready to register yet? Registration is 100% free. Click Here To Join Now!

External Flash file

Discussion in 'Adobe Flash Help' started by coding_artist, Feb 16, 2006.

  1. Offline

    coding_artist New Member

    Message Count:
    7
    Likes Received:
    0
    Trophy Points:
    0
    Hi,
    I am creating a flash site.

    I am stuck on a page in which I have to upload external movie clip (swf) into main movie.
    I want to upload it at the specific location?
    By default it goes to the upper left corner. I want it in the center of the movie.
    Does anyone know how to do that?
    Thank you,


  2. Offline

    Shani I Control U

    Message Count:
    1,140
    Likes Received:
    0
    Trophy Points:
    0
    I have not done this in a couple years, but the logic is intact. I think if you create a symbol (movie or button depending on if you want interaction) the same size as your external clip, you can place that symbol whereever, and have the actionscript call the url within the symbol.


  3. Offline

    minger "I'm addicted to WDF"

    Message Count:
    241
    Likes Received:
    0
    Trophy Points:
    0
    There are two ways to do this. Either you load the movie onto a layer, or into a movieclip.

    The loadMovieNum way
    --------------------------------
    This by default loads into the upper left corner of the stage. When doing this, what you do is make your loaded movies the same size as the original. Then you add the code:
    loadMovieNum("movie.swf", X) where X is the layer that you put it on. 0 is on top of everything, 1 is below that, and so on and so on. I'm not sure how high that goes, but I've never heard of anyone "running out" of layers.

    The loadMovie way
    --------------------------
    This is the way I prefer. I’m not sure why, but I just like it better, even though it seems most people use the method above. In this one, you load the movie into a movie clip. So…for this, I like to first create an empty movie clip. New Symbol > I usually name it emptyMC, then just go back to the stage. When you place it on the stage, it will simply appear as a circle with a cross in it. Give this MC an instance name, such as holder. Now the code:
    loadMovie(“movie.swf”, holder) where holder is whatever the instance is of your empty movie clip (note sometimes it may be necessary to use _parent.holder or whatever). Now, the loaded movie will loaded into the empty MC meaning that it will be on the same layer as your holder movie clip.

    Now, if you’re going to be loading several movie clips into that one spot, make sure to unload the movie each time. In Flash, you don’t unload a movie itself, you unload the movie that’s in a holder, or a layer number. So, for the loadMovie() method, your button code would be:
    on (release) {
    unloadMovie(holder)
    //that unloads whatever movie is in the holder movieclip
    //likewise I THINK you can do unloadMovieNum(1) for the alternate method
    loadMovie(“whatever.swf”, holder)
    }

    If you don’t do this unloading, all of the movies will be playing at the same time, and it will drag flash down quite a bit. Anyways, hope that helps.

    edit: So to answer your one question about loading into the center. If you use the loadMovieNum method, make your loaded swf file the same size, and simply center the image or whatever on that stage. Or, if you’re using the loadMovie method, center your holder movie clip, then move it up and left half of your loaded movie size.


Share This Page