A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Transitions help (Fairly Urgent)

  1. #1
    Senior Member Adam14's Avatar
    Join Date
    Feb 2004
    Location
    Ontario Canada
    Posts
    1,116

    RESOLVED **Transitions help (Fairly Urgent)

    Following the script from a tutorial here:

    http://www.kirupa.com/developer/mx2004/transitions2.htm

    It works fine. Basically it's set up for transitions between external swfs being loaded into a main. Button1 is clicked and movie 1 appears, and plays 'til its midframe. Button2 is clicked, movie 1 plays its remaing frames and then movie two preloads and then starts. The issue is that the preloaders in the tutorial load the swf coming in after the previous one has fullyplayed out. I need to find a way to have movie 2 preload, while movie 1 is still stopped in its midframe, and then once movie 2 is preloaded, movie 1 finishes its frames and then movie 2 starts without a preloader. Hope this makes sense. Basically, here is the script that is on each button:

    code:

    on (release) {
    if (_root.currMovie == undefined) {
    _root.currMovie = "main";
    container.loadMovie("main.swf");
    } else if (_root.currMovie != "main") {
    //container.midframe is set in the beginning of each swf
    if (container._currentframe >= container.midframe) {
    _root.currMovie = "main";
    container.play();
    }
    }
    }



    obviously there are different swf's targetted by each new button

    the preloader is pretty generic:

    code:

    midframe = [yourupdatednumber];
    bytes_loaded = Math.round(this.getBytesLoaded());
    bytes_total = Math.round(this.getBytesTotal());
    getPercent = bytes_loaded/bytes_total;
    this.loadText = Math.round(getPercent*100)+"%";
    if (bytes_loaded == bytes_total) {
    this.gotoAndPlay(3);
    }



    Does anyone out there have any ideas how this can be done....been working on it since last night...and it's driving me batty!!!!

    If you have any questions, or if my explanation does not make sense, please don't hesitate to respond.

    thanks,
    Adam
    Last edited by Adam14; 03-21-2004 at 02:29 AM.

  2. #2
    ActionScript Insomniac
    Join Date
    Jan 2003
    Location
    43d03.21'N, 89d23.65'W
    Posts
    1,173
    Suggestion (untested): make a hiddenContainer clip, off stage, or with _visible = 0. When movie 1 is fully loaded (as assessed by the preloader), load movie 2 into hiddenContainer. Then is will be loaded into memory, so when you call loadMovie again, loading will not be delayed by transmission time. Etc.

  3. #3
    Senior Member Adam14's Avatar
    Join Date
    Feb 2004
    Location
    Ontario Canada
    Posts
    1,116
    Thank you, Thank you, Thank you, Thank you, for responding..I've been refreshing the page every three seconds since I posted this...lol...I know, relax....Now, another question arises...there are actually more than just two buttons...I'm assuming this wouldn't work, only because the animation in each swf doesn't last long enough to preload...This is for someone, and I've not seen all the files, but the one he send me was too quick to have the second swf loaded...do you have any other ideas, or any links to tutorials....or anything...this has been driving me up the frickin' wall...I must have made over 200 changes trying to get this to work...I appreciate your advice more than you know.

    Adam

  4. #4
    ActionScript Insomniac
    Join Date
    Jan 2003
    Location
    43d03.21'N, 89d23.65'W
    Posts
    1,173
    I'm unsure exactly what you mean. If the animations are very short, preloading shouldn't be a big problem. It sounds from your description like Movie 2 takes longer to load than Movie 1 takes to run.

    You could preload all the movies at the start, using the hidden-container approach. Or when movie 1 is started, preload all the rest. (If you're unsure which movie will be played first, that's harder to arrange.)

  5. #5
    Senior Member Adam14's Avatar
    Join Date
    Feb 2004
    Location
    Ontario Canada
    Posts
    1,116
    Thanks again for gettin' back to me. The animations are short, but very rich graphically...lasting about 5 seconds at most, but over 300k in size. I know which one is loaded first, but there's no way the others will be loaded, but you are exactly right when you say "It sounds from your description like Movie 2 takes longer to load than Movie 1 takes to run."...I'm still working on it, and I've torn it all down and I'm starting fresh....man, this will be the death of me ....lol...

    thanks,
    Adam

  6. #6
    ActionScript Insomniac
    Join Date
    Jan 2003
    Location
    43d03.21'N, 89d23.65'W
    Posts
    1,173
    300k for 5 seconds?? Better be some REALLY good pics to be worth the price!

  7. #7
    Senior Member Adam14's Avatar
    Join Date
    Feb 2004
    Location
    Ontario Canada
    Posts
    1,116
    It is actually some really cool looking stuff..I'm only doing the preloader stuf - if I can ever get it figured out so I can't take credit for the animation/graphics.

    Adam

  8. #8
    Senior Member Adam14's Avatar
    Join Date
    Feb 2004
    Location
    Ontario Canada
    Posts
    1,116
    Tore the whole thing apart and did it my way!!!! Got the little prick workin' now...thanks, mkantor for your help..much appreciated.

    Adam

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