dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Preloading Nightmare

  1. #1
    Junior Member
    Join Date
    Oct 2004
    Location
    Chicago IL
    Posts
    9

    Preloading Nightmare

    Wow, Flash has changed. I want to create a loading screen that not only checks for current bytes of the _root movie, but also preloads six flv clips all at once.

    I have a loading move set up with frames 1 - 100 and I am prepared to tell it to goto and stop at the percent that is loaded. Like:

    LoadingView.gotoAndStop( PercentLoaded );

    Okay, so now is the hard part. All of the tutorials I've come accross do not tell me how to handle all of this at once. I want the percent loaded to represent the following:

    mainMovie.swf <-- The root movie for the site that is being loaded

    clipA.flv <-- Small video clips used in the first scene of the move
    clipB.flv <-- I want them loaded and ready to go
    clipC.flv
    clipD.flv

    so PercentLoaded = Like _root.getBytesLoaded() + [clipA.flv].getBytesLoaded() + ... + [clipD.flv].getBytesLoaded()

    and PercentTotal would = Like _root.getBytesTotal() + [clipA.flv].getBytesTotal() + ... + [clipDflv.].getBytesTotal() ;

    These movies are not loaded until their movie clip calls them via the FLVPlayBack component in the first frame of the first scene. Nothing is in the library, it is all dynamic.

    How do I write code for this. NetConnections and oListeners are new territory for me, but I really want to know how to handle these requests.

    Is there a way to handle this easily? Is there some code out there that I can use and teach myself. Is there a good tutorial that I should be looking at?

    Alex

  2. #2
    will i ever get it?
    Join Date
    Feb 2004
    Posts
    707
    just to be clear, are you wanting to preload all the flvs and the root, before starting the movie,
    ...or are you preloading the root, play the root, and then preload the flvs all at once?
    ...or preloading the root, play the root, and preload flvs one at a time?

  3. #3
    Junior Member
    Join Date
    Oct 2004
    Location
    Chicago IL
    Posts
    9
    Yes I want to load all five and the root at once. THen I want to play the root. The five flvs are tiny clips used in links, but it looks bad to have them load after the link rolls out. I want all five flvs and the root to total 100% together and play once they are all loaded

  4. #4
    Junior Member
    Join Date
    May 2000
    Posts
    7
    i need this same thing, i want to know when a swf and the related flv is loaded before the swf starts.

  5. #5
    Senior Member
    Join Date
    Jan 2001
    Location
    London
    Posts
    361
    If you import your videos into flash (ie embed the video) as opposed to loading external FLV files you'll be able to preload the main movie and all the embedded FLVs by checking for _root.getBytesLoaded() as all the data is embedded in the swf.

  6. #6
    Junior Member
    Join Date
    Oct 2004
    Location
    Chicago IL
    Posts
    9
    I am assuming the same would be true if I placed them in a shared library and loaded them into a Trigger Movie???
    Alex

  7. #7
    Senior Member
    Join Date
    Jan 2001
    Location
    London
    Posts
    361
    If you place the FLVs into container movieclips called movie0_mc, movie1_mc... etc. (in your shared library) you'll want to load all those movieclips at once and calculate the overall progress along with the _root.

    So:
    Code:
    var loaded = _root.getBytesLoaded() + movie0_mc.getBytesLoaded() + movie1_mc.getBytesLoaded();
    var total= _root.getBytesTotal() + movie0_mc.getBytesTotal() + movie1_mc.getBytesTotal();
    That code will allow you to load all your assets before continuing.

  8. #8
    Member
    Join Date
    Jul 2004
    Location
    New Haven, CT
    Posts
    79
    Hi all,
    Hope you don't mind me jumping in here, but I am looking for the same solution. I have a main timeline which needs to have a few FLVs play (but I don't want there to be any pause once the main preloader is done. I don't care if they have to wait for 20 minutes to begin the program, as long as once it starts it is fully ready to go).

    So Dene, is your solution to have multiple MCs that just point to FLV files (with the normal FLV player), or are you saying to embed the FLVs into the timeline of those MCs? I ask, because I know there can be audio/video synch issues with embedding long videos.

    Thanks!

    - Kent

  9. #9
    Junior Member
    Join Date
    Oct 2004
    Location
    Chicago IL
    Posts
    9
    It seems like embedding them could be a solution. But want about using the NetStream class. Is there a way to handle them with this?

    I would like to extend the MovieClipLoader to include loading full FLV's. It sounds like that may be feasible, but I am not sure how to use the NetStream class to do so. If I figure it out I will repost.

    Goal: All encompassing loading clip (FLV, Bitmap, MC's, SharedLIb)
    Requirements:
    -Tells user full status with loading bar or loading clip (100 frame animation)
    -Tells user through text what items are loading
    "Loading Assets"
    "Loading Video"
    "Loading Sound"

    I think this is something that can be done, and would make a great reusable object.

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