Skip navigation
Currently Being Moderated

Type was not found or was not a compile-time constant: ArrayCollection

Aug 15, 2011 10:08 AM

I have never seen this type of error before. I was running the asdoc tool when I got the issue to:

 

package adventureGame.util
{
     import mx.collections.ArrayCollection;
 
     public class ACConvertor
     {
          public function toAC(array:Array):ArrayCollection
          {
               var arrayObject:Array = new Array();
               var ac:ArrayCollection = new ArrayCollection();
               
               return ac = arrayObject as ArrayCollection;
          }
     }
}

 

Why am I getting:

 

ACConvertor.as(31): col: 37 Error: Type was not found or was not a compile-time constant: ArrayCollection.

        public function toAC(array:Array):ArrayCollection

 
Replies
  • Currently Being Moderated
    Aug 15, 2011 5:26 PM   in reply to Adrien.

    ArrayCollection and any class that starts with mx... is Flex only code. Are you working in a Flex IDE or in Flash?

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 10, 2012 3:37 PM   in reply to Rob Dillon

    I'm getting the same kind of errors trying to run asdoc. Flash Builder 4.6.

    Does anyone know what causes this? The application works fine, but asdoc find these as errors?

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points