1 Reply Latest reply on Apr 24, 2011 5:38 PM by Ned Murphy

    Flash help- trying to make moving images buttons (getting error 1009)

    Mary Louise Brumit

      Help! I'm trying to create a portfolio website, and I want my picture strip to move in and then become buttons. I have made them buttons, but once the strip stops moving I keep getting this message.

       

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at portfolio_fla::MainTimeline/frame62()
      at flash.display::Sprite/constructChildren()
      at flash.display::Sprite()
      at flash.display::MovieClip()
      at flash.display::Sprite/constructChildren()
      at flash.display::Sprite()
      at flash.display::MovieClip()
      at flash.display::Sprite/constructChildren()
      at flash.display::Sprite()
      at flash.display::MovieClip()
      at flash.display::Sprite/constructChildren()
      at flash.display::Sprite()
      at flash.display::MovieClip()
      at flash.display::Sprite/constructChildren()
      at flash.display::Sprite()
      at flash.display::MovieClip()

       

      This is the code I have in the actions panel

       

      stop();

       

       

       

      //LISTEN FOR THE CLICK OF THE BUTTONS

       

      pics_mc.card_btn.addEventListener(MouseEvent.CLICK, cardClick);

       

      function cardClick(e:MouseEvent):void{
      trace("cardClick");

       

      }

       

      pics_mc.wine_btn.addEventListener(MouseEvent.CLICK, wineClick);

       

      function wineClick(e:MouseEvent):void{
      trace("wineClick");
      }

       

       

       

      pics_mc.edge_btn.addEventListener(MouseEvent.CLICK, edgeClick);

       

      function edgeClick(e:MouseEvent):void{
      trace("edgeClick");

       

      }

       

      pics_mc.group_btn.addEventListener(MouseEvent.CLICK, groupClick);

       

      function groupClick(e:MouseEvent):void{
      trace("groupClick");

       

      }

       

      pics_mc.romeo_btn.addEventListener(MouseEvent.CLICK, romeoClick);

       

      function romeoClick(e:MouseEvent):void{
      trace("romeoClick");

       

      }

       

      I'm new at flash
      thank you!

        • 1. Re: Flash help- trying to make moving images buttons (getting error 1009)
          Ned Murphy Adobe Community Professional & MVP

          The 1009 error indicates that one of the objects being targeted by your code is out of scope.  This could mean that the object....
           
          - is not in the display list
          - doesn't have an instance name (or the instance name is mispelled)
          - does not exist in the frame where that code is trying to talk to it
          - is animated into place but is not assigned instance names in every keyframe for it
          - is one of two or more consecutive keyframes of the same objects with no name assigned in the preceding frame(s).
           
          If you go into your Publish Settings Flash section and select the option to Permit debugging, your error message should have a line number following the frame number which will help you isolate which object is involved.

          Since you say you are moving things in, I suspect the 4th item listed might relate to your problem, but it could be any of them.