SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Apr 2003
    Location
    Belize
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to do ifFrameLoaded gotoAndPlay in Flash 6

    Hi,

    I used to be able to get this done in Flash 5 but Flash 6 has me a bit confused. My Flash Movie has 73 frames. I want to set my movie to pause at frame one and start playing frame 2 only after the entire movie has been loaded.

    Can anyone tell me how to do this in Flash 6?

    Thanks

  2. #2
    SitePoint Wizard aaron.martone's Avatar
    Join Date
    Feb 2003
    Location
    Florida, USA
    Posts
    2,322
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Assuming you mean Flash MX by Flash 6, your request shouldn't be too difficult.

    ifFramesLoaded has been depreciated in Flash MX AS. Try the following :

    Code:
     
    ifFrameLoaded(scene, frame){
       statement;
    }
    ifFrameLoaded(frame){
       statement;
    }
    Flash MX uses moviename._framesLoaded instead now. So try:

    Code:
    if (_framesloaded >= _totalframes) {
       gotoAndPlay ("Scene 1", "start");
    } else {
       _root.loader._xscale = (_framesloaded/_totalframes)*100);
    }

  3. #3
    SitePoint Member
    Join Date
    Apr 2003
    Location
    Belize
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks

  4. #4
    SHIZA
    Join Date
    Apr 2003
    Location
    Great White North
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    also you can just try the BytesLoaded (might be TotalBytesLoaded) set it at the size of your movie and make a simple while loop

  5. #5
    SitePoint Evangelist spoondevil's Avatar
    Join Date
    Jun 2001
    Location
    Harlow, Essex, UK
    Posts
    426
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I still use the
    Code:
    ifFrameLoaded(scene, frame){
     statement;
     }
     ifFrameLoaded(frame){
     statement;
     }
    even in Flash MX and it works fine, why if it is depreciated does it still work?

    Are they slowly phasing it out so in the next version of Flash it won't work at all?


    Gunter

  6. #6
    SitePoint Wizard aaron.martone's Avatar
    Join Date
    Feb 2003
    Location
    Florida, USA
    Posts
    2,322
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Depreciated text was defined because better methods were invoked in Flash MX to handle that functionality.

    Currently Flash MX will run such actionScript, but if you want future version compatibility, I suggest using the new implementations that Flash has invoked.

    I'm not sure that if you use a depreciated function and export as a Flash MX file (as opposed to previous versions), if it will still work or not. Havn't had time to check; time time time; never enough.

  7. #7
    SitePoint Member
    Join Date
    Apr 2003
    Location
    Belize
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the help. I haven't tested it from a remote location yet but I think it will work.

    The other thing I would like to learn how to do is how to let a new movie load on the last frame. Instead of having my movie loop, I'd prefer to have it just load a new movie every time it reaches the last frame. This way as soon as one movie is finished playing another one plays.

    Also it would be good if I could get this to be done randomly so the movies do not play in the same order continously. Any ideas?

  8. #8
    SitePoint Wizard aaron.martone's Avatar
    Join Date
    Feb 2003
    Location
    Florida, USA
    Posts
    2,322
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Well, you don't want the movie to load on the last page. You want to load it before the timeline gets to that frame so that it's ready to go (otherwise you'll need ANOTHER preloaded - which can get annoying to users)

    I recommend Macromedia Flash MX - Advanced ActionScript, a 600 page book on the ins and outs of the majority of AS code; well written, lots of tutorials and a compilation CD. It's done wonders.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •