A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: How do I preload a swf file into a container?

  1. #1
    Junior Member
    Join Date
    Aug 2008
    Posts
    21

    How do I preload a swf file into a container?

    I am creating a website using 1 container, which loads swf files when on release of a button. This is working perfectly, but I cant figure out how I get it to load a swf file when the site opens-!! Can someone give me some pointers??

  2. #2
    Senior Member vinayak.kadam's Avatar
    Join Date
    Oct 2006
    Location
    gotoAndPlay("Pune");
    Posts
    831
    Hello there,

    Heres the trick...........

    1. Assume there are some 20 files to be preloaded..........
    2. Create 20 empty movie clips into your main file
    3. Set up a loop which loads every file serially into the 20 empty movie clips
    4. Set up on enterFrame event to check the status of each file loaded, when one file is loaded 100% start with another
    5. Repeat the above steps till you preload all 20 files

    Hope you get it, if not then u upload your main file here so that we can code it appropriately.....
    As ever,
    Vinayak Kadam

  3. #3
    Junior Member
    Join Date
    Aug 2008
    Posts
    21
    Thanks, Vinayak.

    Not quite what I mean though. I dont want it loading mulitple files, just the one external swf when the main container swf is opened.

    Does that make sense? I am not able to upload the fla file sorry....

  4. #4
    Member
    Join Date
    May 2004
    Posts
    60
    Try loading the movie into the movie that loads into your container. On the clip that loads into your container put the following code on the first frame of the movie.

    Code:
    this.loadMovie("your_swf_name_goes_here")

  5. #5
    Junior Member
    Join Date
    Aug 2008
    Posts
    21
    Wicked! Worked perfectly! Thanks for that!!

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