views:

29

answers:

2

I have some code that uses an ArrayCollection, it imports:

import mx.collections.ArrayCollection;

then:

static protected var myAC:ArrayCollection = new ArrayCollection();

Seems straightforward, but in my project the import (and thus ArrayCollection) are not found/defined!

I am using Flash Builder 4 (Flex 4) - it's an ActionScript project, and project properties is set to Flex SDK 4.0. Everything should be default settings.

When I type "import mx." and press control-space (autocomplete), I see a list of choices such as core, geom and several others, but no 'collections'.

I must be missing something?

A: 
  1. Export your project to zip
  2. Update to FlashBuilder 4.1
  3. Import your project from zip
  4. Forget about your error)
Eugene
+1  A: 

By default, an "ActionScript Project" does not include the framework.swc which contains the flex packages such as mx.collections. If you really want to use ArrayCollection, you'll have add the swc and its corresponding resource bundle swc to your project library path. They are located at:

${FLEX_SDK_HOME}/frameworks/libs/framework.swc
${FLEX_SDK_HOME}/frameworks/locale/${locale}/framework_rb.swc
Dave