我正在尝试制作一部新的flash电影。我使用CS4发布电影-> flash 8- AS-> 3.0。我的问题是,如果我发布电影,我会收到以下编译器错误->
ActionScript 2.0 class scripts may only define class or interface constructs.
Attribute used outside class.
The class or interface 'flash.net.URLVariables' could not be loaded.
The class or interface 'flash.net.URLRequest' could not be loaded.
The class or interface 'flash.net.URLLoader' could not be loaded.
The class or interface 'flash.events.Event' could not be loaded.
The class or interface 'flash.net.URLVariables' could not be loaded.
ActionScript 2.0 class scripts may only define class or interface constructs.
The class or interface 'URLVariables' could not be loaded.我正在使用这个代码。
package
{
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.net.URLVariables;
import flash.net.URLRequestMethod;
import flash.events.Event;
public class PHPData extends Object
{
public function send(script:String, vars:URLVariables):void
{
var req:URLRequest = new URLRequest(script);
req.data = vars;
req.method = URLRequestMethod.POST;
var loader:URLLoader = new URLLoader();
loader.load(req);
loader.addEventListener(Event.COMPLETE, _complete);
}
private function _complete(e:Event):void
{
var vars:URLVariables = new URLVariables(e.target.data);
var i:String;
for(i in vars)
{
trace(i + ": " + vars[i]);
}
e.target.removeEventListener(Event.COMPLETE, _complete);
}
}
}我检查了所有的论坛,我没有得到任何解决方案来纠正这些错误。请提前指点一下谢谢。
发布于 2011-05-31 14:00:05
那个类看起来很眼熟;
https://stackoverflow.com/questions/6183538
复制相似问题