开发者

Types not found while using Vector in AS3

I'm trying to use Vector. in a Flash Professional Project, Person being a custom cl开发者_JAVA百科ass. 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.


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜