1
votes

I'm trying to use Vector. in a Flash Professional Project, Person being a custom class. Eclipse keep saying it cannot find the type in brackets, even if I try with basic types like int or String:

public interface IRenderer
{
    function init(persons : Vector.<int>) : void;
    function render() : void;
}

Type 1046: Type was not found or was not a compile-time constant: int.

I'm working with:

  • Flex 4.1 SDK
  • Flash Builder 4.0.1 (I've just downloaded it today from adobe.com...)
  • Flash Player version = 10.0.45

I've tried to add the Flex SDK in the Build Path but it doesn't work either.

2

2 Answers

2
votes

Early releases of FlashBuilder compile for Flash Player 9.x. Flash Player 9 doesn't support Vector and when a project is configured to target Flash Player 9.x FlashBuilder will show that error if you try to use vector. Take a look at Project > Properties and select the Flex Compiler in the side-bar. If Adobe Flash Player options shows 9.x.x, change it to 10.0.0.

2
votes

Make sure that the playerglobal.swc included in the ActionScript Build Path / Library Path is the Flash 10.X.X version. Sometimes the wrong framework SWCs are loaded