0 Replies Latest reply on Dec 28, 2008 9:57 AM by Sunnyspring

    Flyout menue

    Sunnyspring Level 1
      I am making a vertical flyout menue. Most of it works just fine, but there is still one more problem to solve. When the cursor is on the flyout menue, and from
      there moved back to the main menue, the action just jumps to the next frame. I need some code to direct the action to the right place, either restarting
      the products flyout menue, restarting the services flyout menue, or back to start (if the cursor is moved back to the menue, but outside the menue choices.
      Do anyone have some good ideas how this can be accomplished?

      products_btn and services_btn are the main menue choices.
      prodctsSub_mc and services_mc are the two flyoutmenues, popping out when the main menue choices is rolled over.
      videos_btn and delivery_btn are choices on the flyout menu (I just wrote the code here for one menue choice on each flyout menue for simplicity.

      This code is written on frame 1:
      stop();

      products_btn.onRollOver = function () {
      gotoAndPlay("Main","products");
      }

      services_btn.onRollOver = function () {
      gotoAndPlay("Main","services");
      }

      This code is written on frame 2 (labeled "products" on the "Main" scene):
      stop();

      import mx.transitions.Tween;
      import mx.transitions.Teasing.*;

      var startProductY:Number = productSub_mc._y;
      var myTween:Tween;
      var myTween2:Tween;

      productsSub_mc.videos_btn.enabled = false;

      if (productsSub_mc._alpha == 0) {
      productsSub_mc.videos_btn.enabled = true;
      myTween = new Tween(productsSub_mc,"_alpha",Regular.easeOut,0,100,6,false);
      myTween2 = new Tween(productsSub_mc,"_y",Regular.easeOut,startProductY,StartProductY-10,6,false);
      }

      invisibleproducts_mc.onRollOver = function () {
      if(productsSub_mc.alpha > 0 {
      myTween.stop();
      myTween2.stop();
      productsSub_mc.videos_btn.enabled = false;
      productsSub_mc._alpha = 0;
      productsSub_mc._y = startY;
      gotoAndPlay("Main","start");
      }
      }

      This code is written on frame 3 (labeled "services" on the "Main" scene):
      stop();

      import mx.transitions.Tween;
      import mx.transitions.Teasing.*;

      var startProductY:Number = services_mc._y;
      var myTween:Tween;
      var myTween2:Tween;

      services_mc.delivery_btn.enabled = false;

      if (services_mc._alpha == 0) {
      services_mc.videos_btn.enabled = true;
      myTween = new Tween(services_mc,"_alpha",Regular.easeOut,0,100,6,false);
      myTween2 = new Tween(services_mc,"_y",Regular.easeOut,startProductY,StartProductY-10,6,false);
      }

      invisibleproducts_mc.onRollOver = function () {
      if(services_mc.alpha > 0 {
      myTween.stop();
      myTween2.stop();
      services_mc.videos_btn.enabled = false;
      services_mc._alpha = 0;
      services_mc._y = startY;
      gotoAndPlay("Main","start");
      }
      }