這裏一類是錯誤,我得到:未能導入在ActionScript
1046: Type was not found or was not a compile-time constant: fbAPI.
這裏是我的MXML:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="startGame();">
<mx:Script>
<![CDATA[
import fbAPI;
public function startGame():void {
var fbAPI:fbAPI = new fbAPI(); // breaks on this line
fbAPI.fbLogin();
}
]]>
</mx:Script>
</mx:Application>
這裏是我的fbAPI.as存根也似乎並不得到進口:
package {
public class fbAPI {
import mx.controls.Alert;
public function fbLogin():void {
Alert.show('test');
}
}
}
下半場做到了。我想我已經以一種很時髦的方式將它重命名了,並且這改正了這一點。 – 2010-02-16 01:51:38