??????一種優美的Flex彈出窗口, 跟Ajax的比較, 你覺得如何呢? 先看效果:
?
????? 如下圖新建一個 new MXML component , 這個就是要彈出的窗口了. 新建此項后, 你可以選擇各種希望繼承的控件, 在 " Based on "選項里, "?Filename " 就是類名.
?
------------------ 華麗的分割線 ------------------------
已設置為 "Default Application" 的MXML文件:
<?xml version="1.0" encoding="utf-8"?>
<!-- Main application to demonstrate TitleWindow layout container. -->
<mx:Application
xmlns:mx="
http://www.adobe.com/2006/mxml
" fontSize="
12
" width="
336
" height="
251
" layout="
absolute
"
>
???
<mx:Script>
?????? <![CDATA[
?????????? import
mx.managers.PopUpManager;
?????????? privatefunction
showAlertWindow():void
{
???????????? var
myPanel:alertWindowExample = alertWindowExample(PopUpManager.createPopUp(
this
, alertWindowExample,
true
));
// 這里第三個參數 true 表示: 彈出myPanel窗口后, 是否可以對父級操作, 值為true時, 就會產生背景模糊的效果, 并不能對父級的東西進行操作
?????????? }
?????? ]]>
???
</mx:Script>
???
<mx:Button
label="
按我一下
" click="showAlertWindow()" x="
248
" y="
217
"
/>
</mx:Application>
?
?
----------------------
要彈出的窗口 -
alertWindowExample.mxml
?
<?xml version="1.0" encoding="utf-8"?>
<mx:Panel
xmlns:mx="
http://www.adobe.com/2006/mxml
" layout="
absolute
" width="
256
" height="
204
" fontSize="
12
" title="
彈出的窗口
"
>
???
<mx:Script>
?????? <![CDATA[
?????????? import
mx.managers.PopUpManager;
?????? ]]>
???
</mx:Script>
???
<mx:Label
text="
姓名
:
" x="
10
" y="
10
"
/>
???
<mx:TextInput
x="
52
" y="
8
" text="
Y-boy.cn
"
/>
???
???
<mx:Label
text="
內容
:
" x="
10
" y="
38
"
/>
???
<mx:TextArea
x="
52
" y="
55
" height="
62
" text="
很安逸的效果
...^_^
http://www.RiaHome.cn
"
/>
???
???
<mx:Button
label="
返回
" x="
160
" y="
128
" click="PopUpManager.removePopUp(this
);"
/>
</mx:Panel>
==================
在
Dreamer
的博客上看到的更酷的各種彈出窗口:
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
