开发者

Flash AS3: Problems linking a class to a symbol, classpath not found

开发者 https://www.devze.com 2022-12-21 08:49 出处:网络
Im having problems with classpaths.I have used them before with \"import\" but I\'m not able to link a class directly to symbol in the library.

Im having problems with classpaths. I have used them before with "import" but I'm not able to link a class directly to symbol in the library.

I have a class c:/myfolder/src/myclass.as . In prefer开发者_高级运维nces > AS3 settings, I have c:/myfolder/ as default classpath. I click linkage on the symbol and enter src.myclass . When I click the checkmark, it says 'class not found'. I am able to do: *import src.myclass; and attach the class to an instance on th stage. That works fine, but thats not what I need to do.


It's weird to use src as a package. Typically you'd set your preferences to c:/myfolder/src then put your top level package in there, but...

Check and make sure your file MyClass looks like this:

package src {
  public class MyClass {
     ...
  }
}

If it doesn't then you need to make sure your package matches the directories under your source directory (c:/myfolders).

Also you probably need to include the fully qualified package on the embed tag.


I found the answer. In preferences > AS3 settings the folder "c:\myfolder\" was below ".\". Once I moved it above, it saw the definition normally.

0

精彩评论

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

关注公众号