1 Reply Latest reply on Sep 11, 2010 12:36 PM by kglad

    TypeError: Error #1009:

    dangallagherphoto

      Hi,

      I'm building a flash site and am getting this error relating to two different movie clips within the site; the one below is for the portfolio_mc:

       


      The portfolio button was clicked!

      TypeError: Error #1009: Cannot access a property or method of a null object reference.

      at fl.transitions::Tween/setPosition()

      at fl.transitions::Tween/set position()

      at fl.transitions::Tween()

      at index_fla::MainTimeline/frame20()

      at flash.display::Sprite/constructChildren()

      at flash.display::Sprite()

      at flash.display::MovieClip()

      at index_fla::portfolio_6()

      at flash.display::MovieClip/gotoAndStop()

      at index_fla::MainTimeline/clickSection()

       

      The problem occurred after changing images within the movie clip to a button with an external link. Now when I press the button that introduces the movie clip it does not tween in as it did before. it merely appears and the above error is shown in the output panel. the code relating to the portfolio button and how the movie clip should tween in is:

       

      stop();


      //animate in the home_mc from right to left using the Tween class...


      //flash - go get code that's going to get the tween work...

      import fl.transitions.Tween;

      import fl.transitions.easing.*;

       

      //home_mc animation - animate in...

      var homeTween:Tween = new Tween(home_mc, "x", Regular.easeOut, 1000, 0, 1, true);


      //handle events for buttons...

      about.addEventListener(MouseEvent.CLICK, clickSection);

      home.addEventListener(MouseEvent.CLICK, clickSection);

      portfolio.addEventListener(MouseEvent.CLICK, clickSection);

      studio.addEventListener(MouseEvent.CLICK, clickSection);

      contact.addEventListener(MouseEvent.CLICK, clickSection);


      function clickSection(evtObj:MouseEvent){

      //trace shows what's happening in the output window

      trace ("The "+evtObj.target.name+" button was clicked!")

      //go to the section clicked on...

      gotoAndStop(evtObj.target.name);

       

      and the code located at frame 20 on the timeline where the portfolio_mc appears is as follows:

       

      var portfolioTween:Tween = new Tween(portfolio_mc, "x", Regular.easeOut, 1000, 193, 1, true);

       

      any help with this would hugely appreciated,

      Dan