0 Replies Latest reply on Jan 22, 2007 2:17 PM by Timdej

    Custom class help

    Timdej
      i have a class:

      package As
      {
      import mx.collections.ArrayCollection;

      public class imageHandler
      {
      private var arrayCollection:ArrayCollection;
      [Bindable]
      private var tileObject:Object;


      public function imageHandler(arrayCollection:ArrayCollection):void{
      this.arrayCollection = arrayCollection;

      }

      public function getTileInfo(tileObject:Object):Object{
      this.tileObject = tileObject;
      return tileObject;
      }

      public function nextImage(index:int):Object{


      if(index < arrayCollection.length){
      index++;
      tileObject = arrayCollection.getItemAt(index);
      }
      return tileObject;
      }

      public function previousImage(index:int):Object{

      if(index > 0){
      index--;
      tileObject = arrayCollection.getItemAt(index);
      }
      return tileObject;

      }
      }
      }

      In my main application

      private var ih:imageHandler = new imageHandler(myData);

      myData being an ArrayCollection... which is filled.

      but for example when i call the function ih.nextImage(myList.selectedIndex);

      Mylist being a tile list, i dont get any usuable object returned. When i debugged i saw that the arraycollection within the class wasn't being populated.. i just cant figure out why