时间: 2021-07-31 作者:daque
windows components包括一个不妨拖动的form,常常还要有一封闭按钮链接到scrollpane。你不妨在个中表露form, movieclip,再有外部的swf文献,它不象scrollpane组件那么不妨机动的对个中的实质举行震动拖动,要想实行此功效,你必需将你要表露的实质放在scrollpane组件中而后在载入到windows components。同声你还要领会的是windows components 组件不许表露经过contentpath属性载入的外部实质的form。 1. 兴建一个文书档案,在典型中采用flash form application。
javascript:if(this.width>540)this.width=540">
2. 运用下图做为截图,举行参考构造。
javascript:if(this.width>540)this.width=540">
3. 创造一个新层,表层定名为action,基层定名为component。
4. 拖动一个button组件至场景的component层,将本来例名定名为showwindowbutton。并将label设为show window。
javascript:if(this.width>540)this.width=540">
5. 点击如次图所示的+号,介入一个form.默许下为form1。常常在真实的步调编写中咱们要为其其余定名。
javascript:if(this.width>540)this.width=540">
6. 单击form1,将其层定名为form content。
javascript:if(this.width>540)this.width=540">
7. 保护form1仍居于选中状况,采用文献导出,导出咱们将要表露的文献,本例为loader_content.swf。
javascript:if(this.width>540)this.width=540">
8. 翻开属性面板,树立form1的visible属性为false。由于咱们要实行的是点击完show window按钮它才是看来的。
javascript:if(this.width>540)this.width=540">
9. 单击左侧的运用步调表单,将windows组件拖至场景的component层上,而后简略,咱们只须要让它在库中即可。
10. 在运用步调的场景的action层上输出如次代码。
buttonlistener = new object();buttonlistener.click = function() { mywindow = mx.managers.popupmanager.createpopup(form1.rootscreen, mx.containers.window, false, {title:"a kitty with an attitude", contentpath:"form1" }); mywindow.setsize(320, 240);};showwindowbutton.addeventlistener("click",buttonlistener);
11. 尝试片子。