我正在关注这篇文章,它有一个非常简单的代码来发布来自flex应用程序的推文。
http://rjdesignz.com/adobe-flex/twitter-api-in-air-mobile-app/
这是为AIR Mobile App编写的,但我正在用Flex语言制作AIR WindowedApplication,上面的帖子依赖于以下外部库:
1) AS3 oAuth库http://code.google.com/p/oauth-as3
2) AS3加密https://code.google.com/p/as3crypto/
代码如下:
import org.istashan.oauth.OAuthConsumer;
import org.istashan.oauth.OAuthRequest;
import org.istashan.oauth.OAuthSignatureMethod_HMAC_SHA1;
import org.istashan.oauth.OAuthToken;
import org.istashan.utils.OAuthUtil;
private var requestToken:OAuthToken;
private var accessToken:OAuthToken;
private var oAuthConsumer:OAuthConsumer;
private var accessRequest:OAuthRequest;
protected var signature:OAuthSignatureMethod_HMAC_SHA1 = new OAuthSignatureMethod_HMAC_SHA1();对于所有变量,我得到以下错误,因此我无法编译我的代码:
1046: Type was not found or was not a compile-time constant: OAuthConsumer.
1046: Type was not found or was not a compile-time constant: OAuthRequest.
1046: Type was not found or was not a compile-time constant: OAuthSignatureMethod_HMAC_SHA1.
1046: Type was not found or was not a compile-time constant: OAuthToken.
1046: Type was not found or was not a compile-time constant: OAuthToken.如何解决这个编译时常量问题?
发布于 2013-06-24 19:51:55
安拉姆杜利拉,我找到了我在adobe文档中缺失的地方。这就是:
Error 1046用作类型声明的类或者是未知的,或者是在运行时可能具有不同值的表达式。检查您导入的是正确的类,并且它的包位置没有更改。另外,检查包含代码的包(不是导入的类)是否定义正确(例如,确保使用正确的ActionScript 3.0包语法,而不是ActionScript 2.0语法)。如果所引用的类未在正在使用的命名空间中定义或未定义为public,也可能发生此错误:
public class Foo{}https://stackoverflow.com/questions/17271378
复制相似问题