0 Replies Latest reply on Aug 18, 2008 3:54 AM by jblanke

    I need help with a little glitch

      I can't figure out why, but one of the menus I made keeps getting stuck while animating in. I have two menus that use the exact same code, but with different handlers and names, but for some reason the second one alway gets stuck on it's initial run. So when I play my swf, the movie plays and then I hit "menu", and the first menu slides in perfectly, but when I hit the button to open "directions" (havent made the rest of my buttons link to anything yet), the menu attempts to slide in, but gets stuck, does so in a really jerky movement, or doesnt come in at all. But when you try it the second time around, it works flawlessly.

      take a look for yourself and tell me what you think please, because I need to fix this.

      http://www.myspace.com/thehauntedmuseum


      Here is my code:

      the instance name of the menu with the difficulty is "menu2"









      Attach Code

      stop();





      import flash.accessibility.AccessibilityProperties;
      import fl.video.FLVPlayback;
      import flash.display.Scene;
      import flash.display.MovieClip;
      import fl.video.VideoEvent;

      theVideo_mc.playWhenEnoughDownloaded();
      theVideo_mc.playPauseButton = player_mc;
      theVideo_mc.muteButton = muter_mc;
      theVideo_mc.bufferingBar = buffer_mc;


      import fl.video.VideoEvent;


      theVideo_mc.addEventListener(VideoEvent.COMPLETE,doCompleteVideo);

      function doCompleteVideo(evt:*):void {
      theVideo_mc.pause();
      doDisplayMenu();
      }

      menu_btn.addEventListener(MouseEvent.MOUSE_DOWN,doCompleteVideo);

      function doDisplayMenu():void {
      import flash.filters.BitmapFilterQuality;
      import flash.filters.BlurFilter;

      var blur:BlurFilter = new BlurFilter();
      blur.blurX = 15;
      blur.blurY = 15;
      blur.quality = BitmapFilterQuality.HIGH;
      theVideo_mc.filters = [blur];

      import flash.filters.BitmapFilterQuality;
      import flash.filters.BlurFilter;

      var blur2:BlurFilter = new BlurFilter();
      blur.blurX = 0;
      blur.blurY = 0;
      blur.quality = BitmapFilterQuality.HIGH;
      menum1.filters = [blur];




      import fl.transitions.Tween;
      import fl.transitions.easing.*;
      var myTween:Tween = new Tween(menum1, "x", Elastic.easeOut, menum1.x, 256 , 3 , true);






      menum1.menum1_1.hider.addEventListener(MouseEvent.MOUSE_DOWN,hidden);


      function hidden(event:MouseEvent):void {


      theVideo_mc.play();
      import fl.transitions.Tween;
      import fl.transitions.easing.*;
      var myTween2:Tween = new Tween(menum1, "x", Elastic.easeOut, menum1.x, 1174 , 3 , true);






      import fl.transitions.Tween;
      import fl.transitions.easing.*;
      var myTween3:Tween = new Tween(menu2, "x", Elastic.easeOut, menu2.x, -662 , 3 , true);








      import flash.filters.BitmapFilterQuality;
      import flash.filters.BlurFilter;

      var blur:BlurFilter = new BlurFilter();
      blur.blurX = 0;
      blur.blurY = 0;
      blur.quality = BitmapFilterQuality.HIGH;
      theVideo_mc.filters = [blur];
      }






      menum1.menum1_1.directions.addEventListener(MouseEvent.MOUSE_DOWN,mapShow);







      function mapShow(event:MouseEvent):void {

      import fl.transitions.Tween;
      import fl.transitions.easing.*;
      var myTween4:Tween = new Tween(menu2, "x", Elastic.easeOut, menu2.x, 256 , 3 , true);
      }


      menum1.menum1_1.directions.addEventListener(MouseEvent.MOUSE_DOWN,mapShow2);

      function mapShow2(event:MouseEvent):void {

      import flash.filters.BitmapFilterQuality;
      import flash.filters.BlurFilter;

      var blur:BlurFilter = new BlurFilter();
      blur.blurX = 15;
      blur.blurY = 15;
      blur.quality = BitmapFilterQuality.HIGH;
      menum1.filters = [blur];
      }}



      menu2.menu2_1.closer2.addEventListener(MouseEvent.MOUSE_DOWN,mapHide);


      function mapHide(event:MouseEvent):void {



      import fl.transitions.Tween;
      import fl.transitions.easing.*;
      var myTween5:Tween = new Tween(menu2, "x", Elastic.easeOut, menu2.x, -662 , 3 , true);

      import flash.filters.BitmapFilterQuality;
      import flash.filters.BlurFilter;

      var blur:BlurFilter = new BlurFilter();
      blur.blurX = 0;
      blur.blurY = 0;
      blur.quality = BitmapFilterQuality.HIGH;
      menum1.filters = [blur];
      }





      var myMenu:ContextMenu = new ContextMenu();

      var item0:ContextMenuItem = new ContextMenuItem("©"+" Blankenstein Creations");
      var item1:ContextMenuItem = new ContextMenuItem("The Haunted Museum");
      var item2:ContextMenuItem = new ContextMenuItem("www.pennypickles.org");



      myMenu.hideBuiltInItems();
      myMenu.customItems.push(item0,item1,item2);
      contextMenu = myMenu;


      item2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, goToURL);

      function goToURL(event:ContextMenuEvent):void {
      navigateToURL(new URLRequest(" http://www.pennypickles.com"), "_parent");
      }


      addEventListener ( 'enterFrame', callback_handler)

      function callback_handler(evt:*):void {


      var today:Date = new Date();
      var currentYear = today.getFullYear();
      var currentTime = today.getTime();
      var targetDate:Date = new Date(currentYear,9,31,0,1);
      var targetTime = targetDate.getTime();

      var timeLeft = targetTime - currentTime;

      var sec = Math.floor(timeLeft/1000);
      var min = Math.floor(sec/60);
      var hrs = Math.floor(min/60);
      var days = Math.floor(hrs/24);

      sec = String(sec % 60);
      if(sec.length < 2)
      {
      sec = "0" + sec;
      }

      min = String(min % 60);
      if(min.length < 2 )
      {
      min = "0" + min;
      }

      hrs = String(hrs % 24);
      if(hrs.length < 2)
      {
      hrs = "0" + hrs;
      }
      days = String(days);
      var counter:String = days + " : " + hrs + " : " + min + " : " + sec;
      time_txt.text = counter;