flashdevelop编译出错
<?xmlversion="1.0"encoding="utf-8"?><mx:Applicationxmlns:mx="http://www.adobe.com/200...
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="onCreationComplete()">
<mx:Script>
<![CDATA[
import flash.events.ContextMenuEvent;
import flash.ui.ContextMenu;
import flash.ui.ContextMenuBuiltInItems;
private function onCreationComplete():void
{
var item_1:ContextMenuItem = new ContextMenuItem("三拳真打", true, false);
var item_2:ContextMenuItem = new ContextMenuItem("gotoAndPlay", true);
var item_3:ContextMenuItem = new ContextMenuItem ("haveFun");
var myContextMenu:ContextMenu = new ContextMenu();
myContextMenu.hideBuiltInItems();//出错,说是未定义hideBuiltInItems()这个方法。
myContextMenu.customItems.push(item_1);//出错,也是说为定义customItems这个属性
myContextMenu.customItems.push(item_2);
myContextMenu.customItems.push(item_3);
this.contextMenu=myContextMenu;
}
]]>
</mx:Script>
</mx:Application>
代码没有问题,但是编译错误,用的是flex 4SDK。错误显示如下G:\FlashDevelopproject\New Project\src\Main.mxml(4): col: 9 Error: Unexpected end of token stream. The last token was:
import flash.events.ContextMenuEvent;
import flash.ui.ContextMenu;
import flash.ui.ContextMenuBuiltInItems;
private function onCreationComplete():void
{
var item_1:ContextMenuItem = new ContextMenuItem(".
<![CDATA[
^
Build halted with errors (fcsh).
不知道怎么回事,在flex3里能正常编译,没有错误。。。 展开
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="onCreationComplete()">
<mx:Script>
<![CDATA[
import flash.events.ContextMenuEvent;
import flash.ui.ContextMenu;
import flash.ui.ContextMenuBuiltInItems;
private function onCreationComplete():void
{
var item_1:ContextMenuItem = new ContextMenuItem("三拳真打", true, false);
var item_2:ContextMenuItem = new ContextMenuItem("gotoAndPlay", true);
var item_3:ContextMenuItem = new ContextMenuItem ("haveFun");
var myContextMenu:ContextMenu = new ContextMenu();
myContextMenu.hideBuiltInItems();//出错,说是未定义hideBuiltInItems()这个方法。
myContextMenu.customItems.push(item_1);//出错,也是说为定义customItems这个属性
myContextMenu.customItems.push(item_2);
myContextMenu.customItems.push(item_3);
this.contextMenu=myContextMenu;
}
]]>
</mx:Script>
</mx:Application>
代码没有问题,但是编译错误,用的是flex 4SDK。错误显示如下G:\FlashDevelopproject\New Project\src\Main.mxml(4): col: 9 Error: Unexpected end of token stream. The last token was:
import flash.events.ContextMenuEvent;
import flash.ui.ContextMenu;
import flash.ui.ContextMenuBuiltInItems;
private function onCreationComplete():void
{
var item_1:ContextMenuItem = new ContextMenuItem(".
<![CDATA[
^
Build halted with errors (fcsh).
不知道怎么回事,在flex3里能正常编译,没有错误。。。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询