【发布时间】:2011-05-31 14:00:05
【问题描述】:
我正在尝试创建一个新的 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);
}
}
}
我查看了所有论坛,但没有找到任何解决方案来纠正这些错误。请指导我提前谢谢。
【问题讨论】:
标签: flash