A Flash Developer Resource Site

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    now menacing sydney redact207's Avatar
    Join Date
    Dec 2001
    Posts
    213
    Hey I was wondering if there was any way in flash to preload a movie or intro up to the point dependant on your connection speed whereby the partially loaded intro will only start playing when it's forecasted to be finished downloading before it finishes playing?

    Yea, so if the time it'll take to finish loading is less than the time it takes to play the movie, then it'll start playing (hopefully).

    Also, how does flash load things? Does it do it in order, so say if something in my library is higher in the hierachy then it gets played first, or if a sound event occurs in my intro then it gets loaded first, or does it just loads anything when it feels like it?



    I know that the above isn't worded too great, so I'll try and do it schematically/comparitively:

    (some of my concept code, sorry if it looks a bit.. ugly)

    avgSpeed += (_root.getBytesLoaded()-prevLoaded)/frameRate;//frameRate (var) determines the time interval between the frames ie: intervals where getBytesLoaded() is measured
    avgSpeed = avgSpeed/2;//The avg bandwidth (bps)
    prevLoaded = _root.getBytesLoaded();

    //Find how long it will take to load the rest
    time = (_root.getBytesTotal()-_root.getBytesLoaded())/avgSpeed;
    if(time>(frames*frameRate))
    {
    gotoAndPlay(1);
    }
    //otherwise start movie.

  2. #2
    The world goes - hm.. TheCaramella's Avatar
    Join Date
    Dec 2001
    Location
    Second door on the right, next to the ice bear
    Posts
    642
    Originally posted by redact207
    Hey I was wondering if there was any way in flash to preload a movie or intro up to the point dependant on your connection speed whereby the partially loaded intro will only start playing when it's forecasted to be finished downloading before it finishes playing?
    (...)
    Also, how does flash load things? Does it do it in order, so say if something in my library is higher in the hierachy then it gets played first, or if a sound event occurs in my intro then it gets loaded first, or does it just loads anything when it feels like it?
    uh, IF I understand your questions, the answer could be:
    test your movie. In the test-movie environment, choose to show bandwidth profiler.
    Under the Debug-menu you choose which speed you'd like Flash to load your project in.
    Then choose View > Show Streaming.
    Now you'll get a very visual answer to your questions, hopefully.
    Flash loads things layer by layer, and frame by frame.
    You can decide wether you want Flash to load the layers from top to bottom, or vice versa.
    Flash streams as much as i necessary for the users connection speed to play your movie acceptably. Should do. but don't rely on Flash here. This is why you create preloaders, to avoid your movies play back at an uneven speed.
    Tip: I've created my own connection speed, for mobile phone, at 9.6 kbps.
    Hope this was of some help for you.

  3. #3
    now menacing sydney redact207's Avatar
    Join Date
    Dec 2001
    Posts
    213
    thanks, that was quite helpful. However you mentioned how flash streams as much as necessary for the movie to play correctly given a connection speed. Is there any way to create/manipulate it such that there is/it uses a buffer?

  4. #4
    www.intensewd.com
    Join Date
    Apr 2002
    Location
    Australia
    Posts
    450
    tip:

    mobile phones don't download at 9.6kbps....

    they download significantly slower. if i remember correctly back in the day when i was surfing bbs's after school on a 9600 baud modem....they peaked at about 1 kbps...so unless you want your tests to be grossly inaccurate...

    my tip would be to bump your mobile phone test rate down to about 1kbs..

    cheers,
    Ben

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