A Flash Developer Resource Site

Results 1 to 16 of 16

Thread: Which way loads best ?

  1. #1
    Junior Member
    Join Date
    Jun 2003
    Location
    Glasgow
    Posts
    13

    Which way loads best ?

    Hi there,

    I've been poring through these forums and have found them really helpful but still have a couple of questions about loading in external swfs.

    sorry ... I can tell it's becoming a bit of a tired topic.

    As a new-head I'm trying to keep things relatively simple. I have a blank main movie, into which I've loaded in my menubar and homepage animation using 'loadMovie' as a frame action. From here the plan is to load my pages 'onRelease' of the menubar buttons. As I understand it from what's been written, this is alot better for 56k users in terms of breaking up the download.

    My questions to the mighty panel are :

    1. My individual pages, for good reason, have large images on them. I've put a pre-loader at the beginning of each page but don't like the flow of that too much. I wondered if there was a way to intelligently preload them ... ie. while the user is reading one static section, use the spare bandwidth to work on the next ?

    I read a long thread about streaming bugs with the Flash 6 player that seemed to suggest that once you begin loading something, it's progress cannot be stopped. If that's still true it looks like an obstacle.

    2. Well, perhaps an alternative ... could the large images be pre-loaded (intelligently ... with background spare bandwidth again) though some shared library thus making the swfs. smaller ?

    3. A simple one. If you import an swf to level 1 and then another to level 2 is there any way to preserve the transparency in the imported swfs. so that you can see the movie playing underneath ?



    Sorry about the mammoth essay. Just trying to be concise.


    Thanks in advance to anyone for taking up the mantle.

    cheers


    morg.




  2. #2
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    1. You can load anything, anytime you want to, and almost anywhere in the movie. You'll have to do a lot of testing to get it right, but you can load your first external in the normal way. On the last frame of that movie, put a loadMovie to load the next one, targetting through the main movie path to it's particular empty clip. In that movie, you want a stop on frame one with no other content in frame one so it's effectively invisible. You can keep loading other movies in this way, from the last frame of any movie. Be aware, when you test it, it doesn't work, from the external movie your working on at the time, cause the path is wrong then, but when loaded to the main, they work. You need a lot of faith.

    I read that long thread too, and what really happens is it does stop loading, because there is no more to load. You can see this in the modem lights on a dsl modem. What it does do is it makes the flashplayer 'think' it's still loading, so it uses up processor resources. Even when you leave a site, it's still eating up processor resources, till you reboot. What you can do to help, is unloadMovie on any movie that has already loaded, and the visitor is no longer viewing it, cause they went to the next. The good side is that that swf is still in the Temp file and will load again very fast if they reclick on the button for it.

  3. #3
    Junior Member
    Join Date
    Jun 2003
    Location
    Glasgow
    Posts
    13
    Thanks Iaskwhy,

    I've read alot of your threads, I was hoping it would be you that came to my rescue.

    I'll try out your suggestion ... it sounds smart to me.

    One (well, ... two) further questions though :

    Supposing my code is busy loading the invisible clip2 while my user is reading section 1 ... and as users do, decides to then look at section 3. Is there a way I can halt the loading of one clip and go straight on to another ?

    Secondly ... if I take your principle of inserting a loadMovie action at the end of my external swfs but make it a conditional 'if, else if ... ' statement to determine which swfs have and have not been loaded already ...... will this statement work if I have used unloadMovie on them. - ie. will the 'If' statement detect that the swfs are in the Temp file but no longer in the main movie ?

    Thirdly ... (just being plain cheeky now) does loading a new swf into an occupied level unload the existing one, or do you still have to use the unload command ?

    Thanks mate,


    like your photo by the way


    morg.
    Last edited by new-head; 06-10-2003 at 01:13 PM.

  4. #4
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    One, rather than try to load while others are loading, I would make it so the buttons to load or view the other sections don't come visible till it has loaded. There are some really nice sites around with layouts like that. You can add that code in the loader code of the externals also.

    Secondly, I don't think that would work, cause it's at the end. It can't be read yet if it hasn't loaded to that frame. Bit it's in the temp file if it reaches the last frame. But doing One would take care of that.

    Third, yes.

  5. #5
    Junior Member
    Join Date
    Jun 2003
    Location
    Glasgow
    Posts
    13
    wise words,

    cheers.


  6. #6
    Senior Member
    Join Date
    Apr 2003
    Posts
    103
    hm... heh, sorry to "butt-in", so to speak

    but then am i correct in saying that there is no way

    a) to cut off one loadMovie in the middle to start loading another,

    b) therefore to pre-load some movies if it will not definately be the next thing the user wishes to see,

    c) therefore construct an intelligent pre-loader that loads movies not being looked at yet?

    assuming i have a large amount of data that needs to be loaded, (like a portfolio site), i guess i shouldn't employ the method of making each button appear as they load...

    AND along the same track as your proposal to load buttons as the movie loads...

    d) when you click on a button to load the sub-movie, does the main movie stop loading? or does it load as well as the sub-movie?

  7. #7
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    First, you have to understand how flash movies use your connection to load a movie. Keep in mind that only so much data can be in the wire at any given moment. So... When you start a flash movie load, to your computer, from the server, what happens is that that movie starts to stream in to your temp folder. From there, it is picked up by your Browser flashplayer plugin. With no preloader to bounce frame 2 back to frame 1, then as soon as frame 1 of the movie has loaded, it will play. Then frame 2, 3, out to the last frame of that movie, unless the movie has a stop in it. But that stop only controls the movie 'playhead', not the loading. There is no way to control the load. Once started, it happens. You can stop it only by leaving the movie, leaving the page the movie is on, or pulling the wire out of the wall.

    Should one movie be in the process of loading and you click a button to load another movie to the same level or the same empty clip, then the first will stop, cause you just left that movie for another one. You are not 'pauseing' the load, your ending it. I assume that it is still in the temp file, as much as was loaded, and with windows, when you go back to load that file again, it will continue to load the rest of that file, saving you some time.

    The thing to remember is that every byte you see has to load. One little thing that helps is that these movies go into and stay in the temp file for some time, usually till a reboot, or sometimes forever or until you go in and delete them. You can use this fact to your advantage when designing a flash movie, but there is no way to cheat on loading. If the byte is needed, it has to load at some point. It's just in how you configure your loading that determines how the movie will play. You can't play something that hasn't loaded yet. And you can't give orders to a frame that isn't there.

    To answer d, I think what will happen is both will try and load, slowing down both.

  8. #8
    Senior Member
    Join Date
    Apr 2003
    Posts
    103
    so if i use the same target area, i can essentially create an intelligent (sort of) loader by loading the 1st movie when i enter the selection, then the second when the first one finishes, then the 3rd, etc, but if the user clicks on another movie link, the loadmovie command will override the previous load, and the previous load stops and the other movie will start to load?

    is the flash 6 "bug" still in effect? that would essentially remove the usefulness of my concept... i have read the extremely long thread, and i remember reading something about it being fixed - is it totally?

  9. #9
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    I don't think clicking to load another movie will override the original load. If it's loading to a different level or clip, I thing it tries to load both, slowing them both down.

    I don't see any evidence that the bug is fixed. My resource meter still shows heavy processor loads after a loadMive has loaded, even when all windows are closed. Rebooting drops it back down.

  10. #10
    Senior Member
    Join Date
    Apr 2003
    Posts
    103
    what i meant is loading another movie into the mc where the previous mc was loading... does that kill the previous load or would you simply have now a bigger queue that has to load before you can do anything?

    or perhaps with an unloadmovie to the same mc followed by the loadmovie into the same mc?

    oh boy this is some tough stuff...

    if it doesn't work the macromedia will have some explaining to do...

  11. #11
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Loading a new swf into the same clip, kills whatever is there, even if it's in the process of loading. You don't need to unloadMovie.

  12. #12
    Senior Member
    Join Date
    Apr 2003
    Posts
    103
    so i could then "pre-load" movie one, check if it finishes, then load movie two, then check, then movie 3 etc, and interrupt the loading movie by killing it by loading another into the same mc, and any movie loaded, or parts loaded thereof, will remain until the user next attempts to load the appropriate movie, right?
    so this COULD be considered a pre-loading engine?

    does killing the previous movie by loading another movie into the same mc work or is it affected by the mx player bug?

  13. #13
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    From my testing, even closing the page the movie was on does not stop the player bug. Only a reboot resets the processor. You can well imagine that Macromedia doesn't want that word to get out.

  14. #14
    Junior Member
    Join Date
    Jun 2003
    Location
    Glasgow
    Posts
    13
    S2Mega ....

    I'm as perplexed as you. Perhaps it is my computational naievity (I'm working on my first site) ... but this is the sort of goal you'd imagine Macromedia would srtive for. With so much clever economic compression type-stuff about, across the whole digital spectrum, I think a 'pre-load engine' is a worthy flash component.

    I'm really surprised it's not a standard tutorial.

    Fill us in Iaskwhy ..... why is this not standard.

    Can you do make much difference with runtime assets ?


    morg.

  15. #15
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Preloaders are not really a mystery. I've never understood what is so hard to understand about them, LOL.

    All any preloader does is either stop the playhead or make it bounce between frame 2 and 1. You can control the playhead, but not the load. The load is going to happen, no matter what you do to the playhead. The rest is either eye candy or something as simple as 2 lines of code.

  16. #16
    Junior Member
    Join Date
    Jun 2003
    Location
    Glasgow
    Posts
    13
    OK, change that to a 'load engine' then.

    There's a quantity of material to be loaded and then called by the playhead (or stalled if not ready by pre-loaders) and a fluctuating bandwidth to do it with. Do you not think there should be an order of preference load list you could submit ALONGSIDE your swfs. Something that is read and handled spearately by the flashplayer when it detects zero activity. IT can presumably see whats in the Temp folder and what's not. And IT can presumably monitor bandwidth activity.

    Using pre-loaders and clever site constructions are a must too, but ... I dunno ... do other web forms do this ? HTML, PHP ?

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