1 Reply Latest reply on Jan 25, 2010 5:26 PM by kevinklin

    problem with setting a function to static, it cannot access local array

    cyber0897 Level 1

      hey guys... got an problem in my scripting...

      i basically have a tileList, which contains multiple images and a delete button that gets created in the item renderer.

       

      On click of that button, in the item renderer i call a function deleteImage which basically calls another function to delete from database...

       

      the problem is, once the delete is successful i need to remove that image from the list... and the only way to do that is to remove it from the arraycollection that populates that list...

       

      so im trying to call a function in my local actionscript file from the item renderer...

       

      I have attached an image of my file structure please take a look at that...

       


      basically my item renderer is under modules/imageHandler/components/galleryRenderer.mxml

       

      and its trying to call a function in modules/imageHandler/imageHandlerScript.as

       


      so i created a function in my imageHandlerScript.as with a type declaration "public static" so i would be able to access this function from my item renderer...

       

      the problem is when im trying to remove the item from my array collection

       

      in my public static function im trying to loop through my arraycollection... but when i type

       

      for each(var item:Object in thumbnails){

      }

       

      i get an error that says thumbnails is not defined...

       

       

      problem is it is defined in that file....

       

       

      any suggestions??