您的位置:首页 > 其它

为group/panel等布局空间设置背景图片之一

2011-06-17 15:37 267 查看
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="444" height="233"
styleName="alertDialog"
>
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
</fx:Declarations>

<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";

.alertDialog{
background-color:white;
corner-radius:6;
}

.panelDialog{
top:5;
bottom:5;
left:5;
right:5;
header-height:0;
corner-radius:6;
}

</fx:Style>
<fx:Script>

<!--[CDATA[
import mx.managers.PopUpManager;

[Embed(source="alert/弹出背景.png")]
private var background:Class ;

public var recallFunction:Function;

private function init():void{

}

/**
* 点击确定
* */
protected function button1_clickHandler(event:MouseEvent):void
{
trace("点击了确定按钮");
PopUpManager.removePopUp(this);
recallFunction();

}

]]-->
</fx:Script>
<s:Graphic width="100%" height="100%">
<mx:Image height="223" width="434" source="@Embed(source='alert/弹出背景.png')"/>
<s:Button x="72" y="178" label="确定" height="33" width="85" click="button1_clickHandler(event)"/>
<mx:Image  left="8" top="8" width="94" height="46" source="@Embed(source='alert/中智LOGO.png')"/>
</s:Graphic>
</s:Group>


代码的关键就在于<s:Graphic >标签。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息