1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Tree x="100" y="109" width="200" height="200">
<mx:ArrayCollection>
<mx:Array>
<mx:Object label="CA">
<mx:children>
<mx:Object label="Los Angeles" id="test1" x="150" y="105"/>
<mx:Object label="San Francisco"/>
</mx:children>
</mx:Object>
<mx:Object label="MA">
<mx:children>
<mx:Object label="Boston"/>
</mx:children>
</mx:Object>
</mx:Array>
</mx:ArrayCollection>
</mx:Tree>
<mx:Tree x="337" y="109" height="200" width="200">
<mx:ArrayCollection>
<mx:Array>
<mx:Object label="TA">
<mx:children>
<mx:Object label="New York"/>
<mx:Object label="Washington"/>
</mx:children>
</mx:Object>
<mx:Object label="DA">
<mx:children>
<mx:Object label="Pittsburg" id="test2" x="300" y="170"/>
</mx:children>
</mx:Object>
</mx:Array>
</mx:ArrayCollection>
</mx:Tree>
<mx:Script>
<![CDATA[
public function doInit():void {
// ligne
image.graphics.lineStyle(1, 000000, 1, true, LineScaleMode.NORMAL, CapsStyle.ROUND,
JointStyle.MITER, 1);
image.graphics.moveTo(test1.x, test1.y);
image.graphics.lineTo(test2.x, test2.y);
}
]]>
</mx:Script>
<mx:Button x="71" y="38" label="Button" id="image" click="doInit()"/>
</mx:Application> |
Partager