0 Replies Latest reply on Jul 16, 2007 7:34 PM by Paymon_JG

    TypeError: in output panel????

    Paymon_JG
      ok....well, i'M pretty new to AS. Im using Flash CS3 AS3. I have a custom class that loads my buttons
      with the content and button ID through the of arrays. Im very sorry for the poor explanation but i will be willing to share my
      files with anyone who is willing to take a look and try to help.

      AS on the .flv:

      var aContentClips:Array = new Array(mMain,mInteractive,mPhotos, mCorpId, mPersArt, mDownload, mLinks);
      var aButtonClips:Array = new Array(bMain, bInteractive, bPhotos, bCorpId, bPersArt, bDownloads, bLinks);
      var aLabel:Array = new Array("MAIN","INTERACTIVE","PHOTOGRAPHY","CORPORATE ID","PERSONAL ART","DOWNLOADS","LINKS");

      setUpContent(aContentClips);
      setUpButtons(aButtonClips,aLabel);
      clearAllContent();

      AS on the WebSite.as file:

      package {
      import flash.display.MovieClip;
      public class WebSite extends MovieClip {
      var aContent:Array;
      var aButtons:Array;
      var aLabels:Array;
      function WebSite():void {
      trace("a website is born");
      }
      public function setUpContent(aContentList:Array):void {
      aContent = aContentList;
      }
      public function setUpButtons(aButtonList:Array,aLabelList:Array):void {
      aButtons = aButtonList;
      aLabels = aLabelList;
      var count:Number = aButtons.length;
      for (var i:Number = 0; i < count; i++) {
      this.aButtons .setLabel(aLabel);
      }
      }
      public function clearAllContent():void {
      var count:Number = aContent.length;
      for (var i:Number = 0; i < count; i++) {
      this.aContent .visible = false;
      }
      }
      }
      }

      AS on the ZoomButton.as file:

      package {

      import flash.display.MovieClip;
      import flash.text.TextField;
      import flash.events.Event;
      import flash.events.MouseEvent;

      public class ZoomButton extends MovieClip {

      function ZoomButton():void {
      trace("new zoom button");
      this.addEventListener(MouseEvent.ROLL_OVER, rollover);
      this.addEventListener(MouseEvent.ROLL_OUT, rollout);
      }
      public function setLabel(labelString:String):void {
      this.tLabel.text = labelString;
      }
      function rollover(evt:Event):void {
      trace("rollover");
      }


      function rollout(evt:Event):void {
      trace("rollout");
      }

      }
      }

      im Getting a message in the output panel saying:

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at WebSite/setUpButtons()
      at WebSite/::frame1()

      PLEASE I NEED HELP!!!

      Thanks in advance,
      Josh