A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: The delay between the load and the properties

  1. #1
    Patron Saint of Beatings WilloughbyJackson's Avatar
    Join Date
    Nov 2000
    Location
    Ro-cha-cha-cha, New York
    Posts
    1,992

    The delay between the load and the properties

    Hey gang,

    Awhile ago, I asked about the location when a movie clip would be scaled if you dynamically loading a JPEG into it. As we all guessed, it scales from the upper-left hand corner.

    What I didn't expect was that at time of load in, the values for _width and _height are still for the EmptyMovieClip. It took about 4 frames for Flash to update the _width and _height data.

    Has anyone else experienced this?

    -pXw

  2. #2
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,227
    Anything you load dynamically, being it movie clip, sound, variables or picture, takes time to load.

    Flash movie from your computer send request to load to server,
    the request wonders around the vast internet highways,
    request receives the server,
    server thinks what to do with request,
    server decides to send requested item to the movie,
    item starts to wonder around the internet,
    item receives to the movie,
    movie clip has finally something to get _width and _height from.

    Always good to make sure your requested item has fully loaded before using it

  3. #3
    Patron Saint of Beatings WilloughbyJackson's Avatar
    Join Date
    Nov 2000
    Location
    Ro-cha-cha-cha, New York
    Posts
    1,992
    Yes, but I'm not using it on the internet. I'm testing offline when the images instantly appear.

    It just weirded me out that all the parameters aren't all there.

    _xscale and _yscale work fine. So does _x and _y...

    -pXw

  4. #4
    Moderator
    FK Junkie
    TiefighT's Avatar
    Join Date
    Aug 2000
    Posts
    683
    The concept is still the same, flash has to load the file completely before it bothers populating the properties. Analyzing and loading a file just takes a little time, even if it is readily available on the hard drive.

    A simple 2 frame loop to check whether or not it is loaded before proceding with the movie would be the simplest way to get around it.
    Last edited by TiefighT; 08-05-2003 at 11:41 AM.

  5. #5
    Patron Saint of Beatings WilloughbyJackson's Avatar
    Join Date
    Nov 2000
    Location
    Ro-cha-cha-cha, New York
    Posts
    1,992
    Okay-dokay.

    I'll try that. Thanks.

    Why can _xscale and _yscale effect the image instantously though?

    -pXw

  6. #6
    Moderator
    FK Junkie
    TiefighT's Avatar
    Join Date
    Aug 2000
    Posts
    683
    Probably because they are independant of the loaded file, doesn't matter how big the file is, the xscale will always be 100 (or will always start at 100). The _width and _height are completely dependant on the dimensions of the loaded file, and as such they aren't populated until the file is finished loading.

    Its still not a good idea to go skrewing around with properties until the file is completely loaded though, could produce flakey results .

  7. #7
    Patron Saint of Beatings WilloughbyJackson's Avatar
    Join Date
    Nov 2000
    Location
    Ro-cha-cha-cha, New York
    Posts
    1,992
    True.

    Thanks again.

    -pXw

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