A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Big Problem

  1. #1
    Junior Member
    Join Date
    Sep 2000
    Posts
    5
    I need to pre-load a movie designed for flash-4.
    The entire compleated movie contains over 20 .swf files that load on a mouse event. My problem is I want to load all of the movies(20+)while the Intro.swf is playing so that when the user clicks on a buton they don't have to wait for the movie to load.

  2. #2
    Member
    Join Date
    Mar 2001
    Location
    Venice, CA
    Posts
    88
    It sort of depends on what your issue is. As I see it, you have two issues:
    1) triggering the loading of the 20 movies without actually playing them (visibly), and
    2) knowing when they're loaded.

    To load them, I'd do the following early in your intro movie:

    Code:
    Set Variable: "n" = 0
    Loop While (n < 20)
          Set Variable: "n" = n + 1
          Load Movie ("level"&n&".swf", n)
          Set Property ("_level"&n, Visibility) = 0
    End Loop
    That assumes that your 20 movies have numeric names that you can loop through (level1.swf, level2.swf etc)- if not, you're going to have to either rename them or load them one by one. Either way, I'd suggest you make them invisible right away (Set Property line). Then when you want to display them later, you can set the visibility back to 1:

    Code:
    Set Property ("_level2", Visibility) = 1
    Telling whether they're loaded...if you're able to edit the source for your 20 movies you could have them increment a variable at the root once they're done:

    Code:
    If (_framesloaded = _totalframes)
          Set Variable: "_level0:loadcount" = _level0:loadcount + 1
    End If
    And then if you wanted your level0 movie to play once all 20 were loaded, you could put this either in the loaded movies or in your main movie:

    Code:
          If (_level0:loadcount = 20)
                Begin Tell Target ("_level0")
                      Go to and Play ("startMainMovie")
                End Tell Target
          End If
    That's just one example of how you could do it. I hope it helps a bit!

    Best,
    Kate :)

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