A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Loading External Movies From HTML

  1. #1
    Junior Member
    Join Date
    Aug 2005
    Posts
    4

    Loading External Movies From HTML

    This is driving me to distraction and I'm sure it's a simple fix. I have a Flash menu being called by all pages in a web site. Within that movie, I need to load an external SWF file into a blank movie clip, based on the destination web page. loadMovie won't work because when the user jumps to the destination page, the Flash menu resets itself. I know I need to control with variables, I'm just not sure where and how.

    Thanks for any help or direction.

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    You should actually use load movie, but which movie to load should be controlled by a variable that is set on each html page. You simply append to the places where the swf is mentioned in the embed code, like .....

    myMovie.swf?whatToLoad=gallery.swf

    Then in Flash ( who will read the variable instantly ) have the loadMovie action like ....

    emptyClip.loadMovie(whatToLoad);

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Junior Member
    Join Date
    Aug 2005
    Posts
    4
    Thank you! I KNEW it was so simple I couldn't see the forest for the trees. Too close to a problem for too long.

  4. #4
    Junior Member
    Join Date
    Aug 2005
    Posts
    4
    Well, I thought I had it. The external file loads fine, but then disappears when the new page loads. The empty movie clip loads in the first frame of the movie. The code I am calling from the HTML is "param name="movie" value="Menu.swf?whatToLoad=Acc_Main.swf">".

    The code for the blank movie clip is: "onClipEvent (Load) {
    loadMovie(whatToLoad, "level1");

    }

    The code on the button is: "createEmptyMovieClip("image_mc", "level3");
    image_mc.loadMovie(whatToLoad);"

    Is it that I am not declaring and defining the var "whatToLoad" within the Flash movie?

    As always, I appreciate being shown the error of my ways.

  5. #5
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Its a little confusing having movieclips with instance names like level as in flash a level is a slot in the Flash player where you load movies into.

    Codes on movieclips are regarded as inside movieclips eo your reference to the variable has the wrong path. Should be...

    onClipEvent (load) {
    this.loadMovie(_root.whatToLoad);
    }

    ... as the variable is loaded into the root.

    Not shure why you load the external movie into both a dynamically created movieclip AND the empty movieclip.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  6. #6
    Junior Member
    Join Date
    Aug 2005
    Posts
    4
    Again, my profound thanks. I'm very rusty with Flash, haven't worked with it in a couple of years. Trying to get back up to speed.

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