A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Button Loads new Menu to Fast

  1. #1
    Senior Member 4romAshz2Flashz's Avatar
    Join Date
    Mar 2004
    Location
    Ontario, Canada
    Posts
    213

    Button Loads new Menu to Fast

    I have several menus which are located in seperate .swf files. Each menu has a fade in and a fade out done through a motion tween. The menus are loaded by buttons on the main page. Below is the actionscript that I'm using on the buttons. I want the button to let the previous menu unload, and then load the next. Right now all it does is loads the next immediately. I need a delay. Does anyone know of a way to get it to wait for the previous menu to unload. Thanks!


    on (press) {
    //Remove Current Menu & TV program
    this.menu_container.back.gotoAndPlay(21);
    this.menu_container.control.gotoAndPlay(21);
    tv_container.unloadMovie();
    if (remote_animation._currentframe == 6) {
    animation.enabled = true;
    remote_animation.gotoAndPlay(6);
    }
    if (remote_biography._currentframe == 6) {
    biography.enabled = true;
    remote_biography.gotoAndPlay(6);
    }


    //Disable Vectorscope & Load Remote
    remote_artwork.gotoAndPlay(2);
    this.menu_container.loadMovie ("artwork.swf");
    this.tv_container.loadMovie ("artworkback.jpg");

    }
    Imagination is more important than Knowledge- Albert Einstein

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    unloading is instantaneous, so there is no point to 'wait' for the unload, really. Plus you are loading in the same 'tv_container' and 'menu_container', so there is actually no need to 'unload' anything as the new swfs replace the old ones automatically.

    Now, if you want a delay because of the 'way it feels' before the loading of the new items, you could use setInterval() or have some controller clip play and trigger the loading on its xth frame.

    gparis

  3. #3
    Senior Member 4romAshz2Flashz's Avatar
    Join Date
    Mar 2004
    Location
    Ontario, Canada
    Posts
    213
    I'm new to creating controller clips, but I think I did an alright job. It works partially. How can I check if there is even a previous menu loaded for an else if?

    menu_control.onEnterFrame = function() {
    if (menuload == 1) {
    if (menu_container.back._currentframe == 35) {
    remote_artwork.gotoAndPlay(2);
    menu_container.loadMovie ("artwork.swf");
    tv_container.loadMovie ("artworkback.jpg");
    menuload = 0;
    }
    }
    Imagination is more important than Knowledge- Albert Einstein

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