views:

42

answers:

2

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.

A: 

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.

Michael Prescott
+1  A: 

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

Casey
That was the case, thanks for the tip! By the way, it also didn't compile because the flash player version was set to 9 in Flash CS5, even if the version was 10.0.45 in ActionScript Compiler, inside Flash Builder.
Altefquatre