4 Replies Latest reply on Dec 6, 2009 5:08 AM by Ned Murphy

    Undefined Property Error

    North 60

      I've come across another little probem I hope you can help me with.

      No that I have all my sub menus animating the way they're supposed to and the main menu buttons

      navigating properly I'm having an issue with setting up the navigation on my sub menu buttons.

       

      A little background info:

      I have 4 sub menus on 4 layers beneath my main menu.

      All the buttons have unique instance names but for some reason I am getting an 1120 Undefined Property error on the button instance names.

      I'm not sure if I need to tell what movie clip the buttons are on or not.

       

      Here's my code:

      The sub menu button code I'm having issues with start on line 238 coloured orange.

       

      import fl.transitions.Tween;
      import fl.transitions.easing.*;

       

         
      {
      //Fishing Flyout

       

          var startY:Number = FishingSub_mc.y ;
         
      //Fishing Button Hover Action
         
          function showFishFlyout (event:MouseEvent):void {
              if(FishingSub_mc.alpha == 0){
              var showFishFlyout:Tween = new Tween(FishingSub_mc,"alpha",Regular.easeOut,0,1,1,false);
              var fishFlyout:Tween = new Tween(FishingSub_mc,"y",Regular.easeOut,startY,startY+42,25,false);
              }
          }
         
          Fishing_btn.addEventListener(MouseEvent.MOUSE_OVER,showFishFlyout);
         
      //Hide Fishing Sub Menu

       

          function hideFishFlyout (event:MouseEvent):void {
              if(FishingSub_mc.alpha > 0){
              var hideFishFlyout:Tween = new Tween(FishingSub_mc,"alpha",Regular.easeOut,1,0,1,false);
              var closeFishFlyout:Tween = new Tween(FishingSub_mc,"y",Regular.easeOut,startY+42,startY,25,false);
              }
          }

       


          Home_btn.addEventListener(MouseEvent.MOUSE_OVER,hideFishFlyout);
          AboutUs_btn.addEventListener(MouseEvent.MOUSE_OVER,hideFishFlyout);
          TheLodge_btn.addEventListener(MouseEvent.MOUSE_OVER,hideFishFlyout);
          Hunting_btn.addEventListener(MouseEvent.MOUSE_OVER,hideFishFlyout);
          Rates_btn.addEventListener(MouseEvent.MOUSE_OVER,hideFishFlyout);
          Gallery_btn.addEventListener(MouseEvent.MOUSE_OVER,hideFishFlyout);
          FAQ_btn.addEventListener(MouseEvent.MOUSE_OVER,hideFishFlyout);
          Contact_btn.addEventListener(MouseEvent.MOUSE_OVER,hideFishFlyout);
         
         
      }

       

      {
      //Hunting Flyout

       

          var startY_hunt:Number = HuntingSub_mc.y ;
         
      //Hunting Button Hover Action
         
          function showHuntFlyout (event:MouseEvent):void {
              if(HuntingSub_mc.alpha == 0){
              var showHuntFlyout:Tween = new Tween(HuntingSub_mc,"alpha",Regular.easeOut,0,1,1,false);
              var huntFlyout:Tween = new Tween(HuntingSub_mc,"y",Regular.easeOut,startY_hunt,startY_hunt+42,25,false);
              }
          }
         
          Hunting_btn.addEventListener(MouseEvent.MOUSE_OVER,showHuntFlyout);
         
      //Hide Hunting Sub Menu

       

          function hideHuntFlyout (event:MouseEvent):void {
              if(HuntingSub_mc.alpha > 0){
              var hideHuntFlyout:Tween = new Tween(HuntingSub_mc,"alpha",Regular.easeOut,1,0,1,false);
              var closeHuntFlyout:Tween = new Tween(HuntingSub_mc,"y",Regular.easeOut,startY_hunt+42,startY_hunt,25,false);
              }
          }

       


          Home_btn.addEventListener(MouseEvent.MOUSE_OVER,hideHuntFlyout);
          AboutUs_btn.addEventListener(MouseEvent.MOUSE_OVER,hideHuntFlyout);
          TheLodge_btn.addEventListener(MouseEvent.MOUSE_OVER,hideHuntFlyout);
          Fishing_btn.addEventListener(MouseEvent.MOUSE_OVER,hideHuntFlyout);
          Rates_btn.addEventListener(MouseEvent.MOUSE_OVER,hideHuntFlyout);
          Gallery_btn.addEventListener(MouseEvent.MOUSE_OVER,hideHuntFlyout);
          FAQ_btn.addEventListener(MouseEvent.MOUSE_OVER,hideHuntFlyout);
          Contact_btn.addEventListener(MouseEvent.MOUSE_OVER,hideHuntFlyout);
      }

       


      {
      //Rates Flyout

       

          var startY_rate:Number = RatesSub_mc.y ;
         
      //Rate Button Hover Action
         
          function showRateFlyout (event:MouseEvent):void {
              if(RatesSub_mc.alpha == 0){
              var showRateFlyout:Tween = new Tween(RatesSub_mc,"alpha",Regular.easeOut,0,1,1,false);
              var rateFlyout:Tween = new Tween(RatesSub_mc,"y",Regular.easeOut,startY_rate,startY_rate+42,25,false);
          }
          }
         
          Rates_btn.addEventListener(MouseEvent.MOUSE_OVER,showRateFlyout);
         
      //Hide Rate Sub Menu

       

          function hideRateFlyout (event:MouseEvent):void {
              if(RatesSub_mc.alpha > 0){
              var hideRateFlyout:Tween = new Tween(RatesSub_mc,"alpha",Regular.easeOut,1,0,1,false);
              var closeRateFlyout:Tween = new Tween(RatesSub_mc,"y",Regular.easeOut,startY_rate+42,startY_rate,25,false);
              }
          }

       


          Home_btn.addEventListener(MouseEvent.MOUSE_OVER,hideRateFlyout);
          AboutUs_btn.addEventListener(MouseEvent.MOUSE_OVER,hideRateFlyout);
          TheLodge_btn.addEventListener(MouseEvent.MOUSE_OVER,hideRateFlyout);
          Fishing_btn.addEventListener(MouseEvent.MOUSE_OVER,hideRateFlyout);
          Hunting_btn.addEventListener(MouseEvent.MOUSE_OVER,hideRateFlyout);
          Gallery_btn.addEventListener(MouseEvent.MOUSE_OVER,hideRateFlyout);
          FAQ_btn.addEventListener(MouseEvent.MOUSE_OVER,hideRateFlyout);
          Contact_btn.addEventListener(MouseEvent.MOUSE_OVER,hideRateFlyout);
      }
         
         
         
      {
      //Gallery Flyout

       

          var startY_gallery:Number = GallerySub_mc.y ;
         
      //Gallery Button Hover Action
         
          function showGalleryFlyout (event:MouseEvent):void {
              if(GallerySub_mc.alpha == 0){
              var showGalleryFlyout:Tween = new Tween(GallerySub_mc,"alpha",Regular.easeOut,0,1,1,false);
              var galleryFlyout:Tween = new Tween(GallerySub_mc,"y",Regular.easeOut,startY_gallery,startY_gallery+42,25,false);
              }
          }
         
          Gallery_btn.addEventListener(MouseEvent.MOUSE_OVER,showGalleryFlyout);
         
      //Hide Rate Sub Menu

       

          function hideGalleryFlyout (event:MouseEvent):void {
              if(GallerySub_mc.alpha > 0){
              var hideGalleryFlyout:Tween = new Tween(GallerySub_mc,"alpha",Regular.easeOut,1,0,1,false);
              var closeGalleryFlyout:Tween = new Tween(GallerySub_mc,"y",Regular.easeOut,startY_gallery+42,startY_gallery,25,false);
              }
          }

       


          Home_btn.addEventListener(MouseEvent.MOUSE_OVER,hideGalleryFlyout);
          AboutUs_btn.addEventListener(MouseEvent.MOUSE_OVER,hideGalleryFlyout);
          TheLodge_btn.addEventListener(MouseEvent.MOUSE_OVER,hideGalleryFlyout);
          Fishing_btn.addEventListener(MouseEvent.MOUSE_OVER,hideGalleryFlyout);
          Hunting_btn.addEventListener(MouseEvent.MOUSE_OVER,hideGalleryFlyout);
          Rates_btn.addEventListener(MouseEvent.MOUSE_OVER,hideGalleryFlyout);
          FAQ_btn.addEventListener(MouseEvent.MOUSE_OVER,hideGalleryFlyout);
          Contact_btn.addEventListener(MouseEvent.MOUSE_OVER,hideGalleryFlyout);
      }
         

       

      //Button Navigation

       

      //Home Button
          function gotoHome (event:MouseEvent):void
      {
          var homePageRequest:URLRequest = new URLRequest
          ("default.html");
          navigateToURL(homePageRequest,"_self");
      }
          Home_btn.addEventListener(MouseEvent.CLICK,gotoHome);
         
      //About Us Button
          function gotoAboutUs (event:MouseEvent):void
      {
          var aboutuspagerequest:URLRequest = new URLRequest
          ("about_us.html");
          navigateToURL(aboutuspagerequest,"_self");
      }
          AboutUs_btn.addEventListener(MouseEvent.CLICK,gotoAboutUs);
         
      //The Lodge Button
          function gotoTheLodge (event:MouseEvent):void
      {
          var thelodgepagerequest:URLRequest = new URLRequest
          ("lodge.html");
          navigateToURL(thelodgepagerequest,"_self");
      }
          TheLodge_btn.addEventListener(MouseEvent.CLICK,gotoTheLodge);
         
      //Fishing Button
          function gotoFishing (event:MouseEvent):void
      {
          var thefishingpagerequest:URLRequest = new URLRequest
          ("fishing.html");
          navigateToURL(thefishingpagerequest,"_self");
      }
          Fishing_btn.addEventListener(MouseEvent.CLICK,gotoFishing);
         
      //Hunting Button
          function gotoHunting (event:MouseEvent):void
      {
          var thehuntingpagerequest:URLRequest = new URLRequest
          ("hunting.html");
          navigateToURL(thehuntingpagerequest,"_self");
      }
          Hunting_btn.addEventListener(MouseEvent.CLICK,gotoHunting);
         
      //Rates Button
          function gotoRates (event:MouseEvent):void
      {
          var theratespagerequest:URLRequest = new URLRequest
          ("rates.html");
          navigateToURL(theratespagerequest,"_self");
      }
          Rates_btn.addEventListener(MouseEvent.CLICK,gotoRates);
         
      //Gallery Button
          function gotoGallery (event:MouseEvent):void
      {
          var thegallerypagerequest:URLRequest = new URLRequest
          ("gallery.html");
          navigateToURL(thegallerypagerequest,"_self");
      }
          Gallery_btn.addEventListener(MouseEvent.CLICK,gotoGallery);
         
      //FAQ Button
          function gotoFaq (event:MouseEvent):void
      {
          var thefaqpagerequest:URLRequest = new URLRequest
          ("faq.html");
          navigateToURL(thefaqpagerequest,"_self");
      }
          FAQ_btn.addEventListener(MouseEvent.CLICK,gotoFaq);
         
      //Contact Button
          function gotoContact (event:MouseEvent):void
      {
          var thecontactpagerequest:URLRequest = new URLRequest
          ("contact.html");
          navigateToURL(thecontactpagerequest,"_self");
      }
          Contact_btn.addEventListener(MouseEvent.CLICK,gotoContact);

       

      //Fishing Sub Menu Buttons
         
      //Conservation Policy
          function gotoConservationPolicy (event:MouseEvent):void
      {
          var theconservationpolicypagerequest:URLRequest = new URLRequest
          ("conservation_policy.html");
          navigateToURL(theconservationpolicypagerequest,"_self");
      }
          ConservationPolicy_btn.addEventListener(MouseEvent.CLICK,gotoConservationPolicy);
         
      //Fish Rates Button
          function gotoFishRates (event:MouseEvent):void
      {
          var thefishratespagerequest:URLRequest = new URLRequest
          ("fish_rates.html");
          navigateToURL(thefishratespagerequest,"_self");
      }
          FishRates_btn.addEventListener(MouseEvent.CLICK,gotoFishRates);
         
      //Fish Licensing Button
          function gotoFishLicensing (event:MouseEvent):void
      {
          var thefishlicensingpagerequest:URLRequest = new URLRequest
          ("fish_licensing.html");
          navigateToURL(thefishlicensingpagerequest,"_self");
      }
          FishLicensing_btn.addEventListener(MouseEvent.CLICK,gotoFishLicensing);
         
      //The Fish Button
          function gotoTheFish (event:MouseEvent):void
      {
          var thefishpagerequest:URLRequest = new URLRequest
          ("the_fish.html");
          navigateToURL(thefishpagerequest,"_self");
      }
          TheFish_btn.addEventListener(MouseEvent.CLICK,gotoTheFish);

        • 1. Re: Undefined Property Error
          Ned Murphy Adobe Community Professional & MVP

          In your Publish settings select the option to permit debugging.   That will likely add some information into the error message, such as a line number.  Then try to run the file again and copy the error message into your posting.  If you are able to see that the line is identified in the error, indicate which line it is in the code you show.

          • 2. Re: Undefined Property Error
            North 60 Level 1

            Sorry Ned

            Should have put that in. 

             

            Here is the sub button code with the lines that have errors.


            //Fishing Sub Menu Buttons
               
            //Conservation Policy
                function gotoConservationPolicy (event:MouseEvent):void
            {
                var theconservationpolicypagerequest:URLRequest = new URLRequest
                ("conservation_policy.html");
                navigateToURL(theconservationpolicypagerequest,"_self");

            }
                ConservationPolicy_btn.addEventListener(MouseEvent.CLICK,gotoConservationPolicy );
               
            //Fish Rates Button
                function gotoFishRates (event:MouseEvent):void
            {
                var thefishratespagerequest:URLRequest = new URLRequest
                ("fish_rates.html");
                navigateToURL(thefishratespagerequest,"_self");
            }

                FishRates_btn.addEventListener(MouseEvent.CLICK,gotoFishRates);
               
            //Fish Licensing Button
                function gotoFishLicensing (event:MouseEvent):void
            {
                var thefishlicensingpagerequest:URLRequest = new URLRequest
                ("fish_licensing.html");
                navigateToURL(thefishlicensingpagerequest,"_self");
            }

                FishLicensing_btn.addEventListener(MouseEvent.CLICK,gotoFishLicensing);
               
            //The Fish Button
                function gotoTheFish (event:MouseEvent):void
            {
                var thefishpagerequest:URLRequest = new URLRequest
                ("the_fish.html");
                navigateToURL(thefishpagerequest,"_self");
            }

                TheFish_btn.addEventListener(MouseEvent.CLICK,gotoTheFish);

             

            And the errors:

             

            errors.JPG

            • 3. Re: Undefined Property Error
              North 60 Level 1

              Got it figured out Ned.

              I needed to put the code in an actions panel in the sub menu movie clip.

              OOPS.  

              I'm picking this Actionscript thing up fairly quickly now.......................I'm sure I'll implode when I go to create some photo galleries though. 

              • 4. Re: Undefined Property Error
                Ned Murphy Adobe Community Professional & MVP

                I like hearing someone say they figured it out... that's the best way to learn this stuff... suffer to a solution.