【问题标题】:Flash CC AS3 - using .swc filesFlash CC AS3 - 使用 .swc 文件
【发布时间】:2015-01-30 05:42:34
【问题描述】:

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

问题是,我不明白在那之后该怎么做。链接它似乎什么都不做。我确定我可能遗漏了一些明显的东西。

我完全按照this page 上的步骤进行操作。

但是在导入并尝试使用给定的代码初始化.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.

【问题讨论】:

    标签: actionscript-3 flash swc


    【解决方案1】:

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

      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();
    

    【讨论】:

    • 添加 swc 只会使这些类可供程序使用。但是如果您没有参考它们,它们将不会被使用。当您想在课堂上使用它们时,您还必须导入它们。
    猜你喜欢
    • 2011-09-07
    • 2010-09-12
    • 1970-01-01
    • 1970-01-01
    • 2010-12-04
    • 1970-01-01
    • 1970-01-01
    • 2010-11-23
    • 1970-01-01
    相关资源
    最近更新 更多