开发者

How to address "Packages cannot be nested" error

开发者 https://www.devze.com 2022-12-24 10:07 出处:网络
I\'m having a problem with Flex 4 beta 2... I can\'t call a class using: <fx:Script source:\"myClass\"/>

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

精彩评论

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