Flash CC AS3 - 使用 .swc 文件



我厌倦了无法弄清楚如何使用.swc文件。我已经搜索了又搜索,但无论我走到哪里,人们都只解释在您的发布settings > library path> SWC等中链接.swc文件的步骤。

问题是,我不知道在那之后该怎么办。 链接它似乎没有任何作用。我敢肯定我可能错过了一些明显的东西。

我完全按照此页面上的步骤进行操作。

但是在导入并尝试使用给定的代码初始化.swc后,我的编译器会抛出此错误:

Scene 1, Layer 'Layer 1', Frame 1, Line 1, Column 33    1180: Call to a possibly undefined method ServiceAPI.
Scene 1, Layer 'Layer 1', Frame 1, Line 1, Column 16    1046: Type was not found or was not a compile-time constant: ServiceAPI.

您是否尝试过导入这些类?我相信这就是原因。尝试:

  import com.shephertz.app42.paas.sdk.as3.user.UserService;
  import com.shephertz.app42.paas.sdk.as3.ServiceAPI;
  import com.shephertz.app42.paas.sdk.as3.storage.StorageService;
  var serviceAPI:ServiceAPI = new ServiceAPI('apiKey', 'secretKey');
  var userService:UserService = serviceAPI.buildUserService();  
  var storageService:StorageService = serviceAPI.buildStorageService();

最新更新