我在 flash cs5 中的组合框有问题。我按照此处的指南创建了一个组合框http://help.adobe.com/en_US/as3/components/WS5b3ccc516d4fbf351e63e3d118a9c65b32-7fa9.html
我的 AS3 代码如下:
import fl.controls.ComboBox;
import fl.data.DataProvider;
import flash.net.navigateToURL;
var sfUniversities:Array = new Array(
{label:"University of California, Berkeley",
data:"http://www.berkeley.edu/"},
{label:"University of San Francisco",
data:"http://www.usfca.edu/"},
{label:"San Francisco State University",
data:"http://www.sfsu.edu/"},
{label:"California State University, East Bay",
data:"http://www.csuhayward.edu/"},
{label:"Stanford University", data:"http://www.stanford.edu/"},
{label:"University of Santa Clara", data:"http://www.scu.edu/"},
{label:"San Jose State University", data:"http://www.sjsu.edu/"}
);
var aCb:ComboBox = new ComboBox();
aCb.dropdownWidth = 210;
aCb.width = 200;
aCb.move(150, 50);
aCb.prompt = "San Francisco Area Universities";
aCb.dataProvider = new DataProvider(sfUniversities);
aCb.addEventListener(Event.CHANGE, changeHandler);
addChild(aCb);
function changeHandler(event:Event):void {
var request:URLRequest = new URLRequest();
request.url = ComboBox(event.target).selectedItem.data;
navigateToURL(request);
aCb.selectedIndex = -1;
}
我在与组合框相同的帧上还有一个简单的后退按钮,单击该按钮可将您带到上一帧。
我的按钮:
btnBack.addEventListener(MouseEvent.CLICK, clickBack);
function clickBack(event:MouseEvent):void
{
gotoAndStop(333);
}
问题是当点击按钮时,组合框停留在屏幕上。我希望组合框仅在单个框架中可见。
单击按钮后如何摆脱组合框?
谢谢你的帮助 :)