开发者

How to address "Packages cannot be nested" error

I'm having a problem with Flex 4 beta 2...

I can't call a class using: <fx:Script source:"myClass"/>

For some reason, no matter what I do, the error is always the same:

Packages cannot be nested

I found links to help.adobe.com,开发者_如何学Python but they were all broken links.

So, is this a Flex bug or there is a new way to use external classes in Flash Builder 4?


i think you have to write: <fx:Script source="myClass"/> ( no colon but the equal sign .... )

... and myClass must be an actionScript file and not a class


Thanks NSP!

  1. I removed the package and class declarations from my .as file (along with the scope brackets '{' and '}).
  2. I used the '=' symbol as the assignment operator (as you suggested).

E.G.:

<fx:Script source="Greeter.as">

That did the trick.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜