A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Determining if a jpeg has loaded?

  1. #1
    Member
    Join Date
    Jan 2001
    Posts
    54

    Determining if a jpeg has loaded?

    I have the following load code:
    Code:
    _root.loaderMC.loadMovie("new.jpeg");
    and what I'd like to do is to have the timeline hold there until the rather large jpeg has finished loading. What's the easiest method to accomplish this?

    Thanks in advance!


  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Easiest is to use what you have and a stop....

    _root.loaderMC.loadMovie("new.jpeg");
    _root.stop();

    ....AND to have this ON the loaderMC clip.....

    onClipEvent(load){
    _root.play();
    }

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    ...loadMovie("your.jpg", 1);
    you still need to call the level you want to load the movie on and have you already created a empty movie clip?

    Next you need a preloader that is attached to your _root movie and you will need it to kick off. when the preloader hits 100% call a function(then you can run your loaded actions thru the function) or set a loaded variable from false to true(then youcan use a if statment on the other file to find out if the movie is loaded).


    Hope this helps!

    Quince

  4. #4
    Member
    Join Date
    Jan 2001
    Posts
    54
    Originally posted by pellepiano
    Easiest is to use what you have and a stop....

    _root.loaderMC.loadMovie("new.jpeg");
    _root.stop();

    ....AND to have this ON the loaderMC clip.....

    onClipEvent(load){
    _root.play();
    }
    So adding the stop obviously works, but the "onClipEvent" to the empty movieclip doesn't work, as the (load) portion just calls the "play" when the movieclip first appears on the timeline, not necessarily when the jpeg data that is being loaded into the MC finishes.

  5. #5
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    The on load action is triggered everytime anything is loaded into the movieclip.
    It slipped my mind though that the action is also triggered when the mc is introduced, but is easily fixed by a if statement

    onClipEvent(load){
    if(_root.ok != 1){
    }else{
    _root.ok=1;
    _root.play();
    }

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

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