UIComponent
来源:互联网 发布:web服务器软件是什么 编辑:程序博客网 时间:2024/04/29 13:38
转:http://www.cnblogs.com/wingfay/archive/2008/02/29/1086075.html
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" borderColor="#FFFFFF" >
<mx:Script>
<![CDATA[
import mx.effects.Move;
import mx.controls.*;
import mx.core.*;
import mx.effects.*;
public var lines :Sprite = new Sprite ();
public var lines1 :flash.display.Sprite = new Sprite ();
public function TestPaint():void
{
//Alert.show("Hello World!");
lines.graphics.lineStyle(2,0x0099ff,1);
DrawLine(lines,lbl,btn1);
DrawLine(lines,lbl,btn2);
DrawLine(lines,lbl,btn3);
var comp: UIComponent = new UIComponent();
comp.addChild(lines);
addChild(comp);
}
public function DrawLine(lines:Sprite,uFrom:UIComponent,uTo:UIComponent):void
{
lines.graphics.moveTo(uFrom.x+uFrom.width/2,uFrom.y+uFrom.height/2);
lines.graphics.lineTo(uTo.x+uTo.width/2,uTo.y+uTo.height/2);
}
public function btn1_mouseOver(event:Event):void
{
lines1.graphics.lineStyle(2,0xd43dd6,1);
DrawLine(lines1,btn1,btn2);
DrawLine(lines1,btn1,lbl);
var comp: UIComponent = new UIComponent();
comp.addChild(lines1);
addChild(comp);
}
public function btn1_mouseOut(event:Event):void
{
lines1.graphics.clear();
DrawLine(lines,lbl,btn1);
}
public function Testmove():void
{
var move:Move = new Move();
if(btn2.x!=lbl.x)
{
move.target=btn2;
move.end();
move.xTo=lbl.x;
move.yTo=lbl.y;
move.play();
}
else
{
move.target=btn2;
move.end();
move.xTo=340;
move.yTo=104;
move.play();
}
}
]]>
</mx:Script>
<mx:Button x="176" y="34" label="btn1" id="btn1" mouseOver="btn1_mouseOver(event)" mouseOut="btn1_mouseOut(event)"/>
<mx:Button x="340" y="104" label="btn4" id="btn2"/>
<mx:Button x="53" y="167" label="btn3" id="btn3"/>
<mx:Button x="131" y="373" label="Paint" click="TestPaint()"/>
<mx:Label x="176" y="169" text="LblMiddle" width="71" height="20" id="lbl"/>
<mx:Button x="303" y="324" label="Move" click="Testmove()"/>
</mx:Application>
- UIComponent
- UIComponent研究
- LifeCycle of UIcomponent
- Using the UIComponent class
- Observations on UIComponent Drawing
- UIComponent之life cycle
- UIComponent Shape Graphics
- Adobe Flex UIComponent LifeCycle
- UIComponent.document是Application
- Adobe Flex UIComponent LifeCycle
- UIComponent的生命周期(life cycle)
- UIComponent的生命周期(life cycle)
- 一次设定多个style给UIComponent
- [转] UIComponent的生命周期(life cycle)
- flex中UIComponent代码研究解析
- 使用UIComponent.getId()区分按钮操作
- jsf ActionListener 查找正确的UIComponent
- JSF in Action读书笔记(二)自定义UIComponent
- JAVA基础知识精华总结
- dom4j取xml指定节点值方法的备份
- 独家:程序员五大层次,你属于哪一层?
- 说说字符集和编码
- POJ 1002 487-3279
- UIComponent
- ivalidateRect和invalidate 和updateData
- 微软的面试题及答案-超变态但是很经典
- 科学发展观
- 给大学生的忠告!!
- 学习effective c++笔记(22---25)
- 多线程与界面交互
- Windows XP hosts文件不起作用的解决办法
- mxml中动态生成组件