| <?xml version="1.0" encoding="utf-8"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| --> |
| <s:Application height="450" width="600" |
| xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark" |
| ><s:layout> <s:VerticalLayout paddingLeft="50"/> </s:layout> |
| <fx:Script> |
| <![CDATA[ |
| import mx.geom.TransformOffsets; |
| import spark.primitives.Ellipse; |
| import mx.graphics.SolidColor; |
| import spark.primitives.supportClasses.GraphicElement; |
| |
| public function addEllipseAt( i:int, color:int=0xFFFF00, width:int=40, height:int=30):void |
| { |
| var myEllipse:Ellipse = new Ellipse(); |
| myEllipse.width=width; myEllipse.height=height; |
| var myFill:SolidColor = new SolidColor(); |
| myFill.color = color; |
| myEllipse.fill = myFill; |
| myEllipse.postLayoutTransformOffsets=new TransformOffsets(); |
| fc.addElementAt(myEllipse, i); |
| } |
| |
| public function addData():void |
| { |
| addEllipseAt(0); |
| addEllipseAt(1,0xFF00FF, 30,40); |
| addEllipseAt(2,0x330066, 40,40); |
| addEllipseAt(1,0xFFFF00, 20,10); |
| } |
| |
| ]]> |
| </fx:Script> |
| <mx:HBox> |
| |
| <mx:VBox> |
| <mx:Label text="Change" /> |
| <mx:Label text="x" /> |
| <mx:Label text="y" /> |
| <mx:Label text="z" /> |
| <mx:Label text="rotationX" /> |
| <mx:Label text="rotationY" /> |
| <mx:Label text="rotationZ" /> |
| <mx:Label text="scaleX" /> |
| <mx:Label text="scaleY" /> |
| <mx:Label text="scaleZ" /> |
| |
| </mx:VBox> |
| <mx:VBox> |
| <mx:Label text="Offsets Matrix" /> |
| <mx:HSlider width="200" value="0" minimum="-160" maximum="160" liveDragging="true" id="sz1" change=" ( fc.getElementAt(2) as GraphicElement).postLayoutTransformOffsets.x=sz1.value"/> |
| <mx:HSlider width="200" value="0" minimum="-160" maximum="160" liveDragging="true" id="sz2" change=" ( fc.getElementAt(2) as GraphicElement).postLayoutTransformOffsets.y=sz2.value"/> |
| <mx:HSlider width="200" value="0" minimum="-160" maximum="160" liveDragging="true" id="sz3" change=" ( fc.getElementAt(2) as GraphicElement).postLayoutTransformOffsets.z=sz3.value"/> |
| <mx:HSlider width="200" value="0" minimum="-360" maximum="360" liveDragging="true" id="sz4" change=" ( fc.getElementAt(2) as GraphicElement).postLayoutTransformOffsets.rotationX=sz4.value"/> |
| <mx:HSlider width="200" value="0" minimum="-360" maximum="360" liveDragging="true" id="sz5" change=" ( fc.getElementAt(2) as GraphicElement).postLayoutTransformOffsets.rotationY=sz5.value"/> |
| <mx:HSlider width="200" value="0" minimum="-360" maximum="360" liveDragging="true" id="sz6" change=" ( fc.getElementAt(2) as GraphicElement).postLayoutTransformOffsets.rotationZ=sz6.value"/> |
| <mx:HSlider width="200" value="1" minimum="1" maximum="20" liveDragging="true" id="sz7" change=" ( fc.getElementAt(2) as GraphicElement).postLayoutTransformOffsets.scaleX=sz7.value"/> |
| <mx:HSlider width="200" value="1" minimum="1" maximum="20" liveDragging="true" id="sz8" change=" ( fc.getElementAt(2) as GraphicElement).postLayoutTransformOffsets.scaleY=sz8.value"/> |
| <mx:HSlider width="200" value="1" minimum="1" maximum="20" liveDragging="true" id="sz9" change=" ( fc.getElementAt(2) as GraphicElement).postLayoutTransformOffsets.scaleZ=sz9.value"/> |
| <s:Button label="Layer++" click=" ( fc.getElementAt(2) as GraphicElement).depth++" /> |
| </mx:VBox> |
| <mx:VBox> |
| <mx:Label text="Matrix 3D" /> |
| <mx:HSlider width="200" value="0" minimum="-160" maximum="160" liveDragging="true" id="sz10" change=" ( fc.getElementAt(2) as GraphicElement).x=sz10.value"/> |
| <mx:HSlider width="200" value="0" minimum="-160" maximum="160" liveDragging="true" id="sz20" change=" ( fc.getElementAt(2) as GraphicElement).y=sz20.value"/> |
| <mx:HSlider width="200" value="0" minimum="-160" maximum="160" liveDragging="true" id="sz30" change=" ( fc.getElementAt(2) as GraphicElement).z=sz30.value"/> |
| <mx:HSlider width="200" value="0" minimum="-360" maximum="360" liveDragging="true" id="sz40" change=" ( fc.getElementAt(2) as GraphicElement).rotationX=sz40.value"/> |
| <mx:HSlider width="200" value="0" minimum="-360" maximum="360" liveDragging="true" id="sz50" change=" ( fc.getElementAt(2) as GraphicElement).rotationY=sz50.value"/> |
| <mx:HSlider width="200" value="0" minimum="-360" maximum="360" liveDragging="true" id="sz60" change=" ( fc.getElementAt(2) as GraphicElement).rotationZ=sz60.value"/> |
| <mx:HSlider width="200" value="1" minimum="1" maximum="20" liveDragging="true" id="sz70" change=" ( fc.getElementAt(2) as GraphicElement).scaleX=sz70.value"/> |
| <mx:HSlider width="200" value="1" minimum="1" maximum="20" liveDragging="true" id="sz80" change=" ( fc.getElementAt(2) as GraphicElement).scaleY=sz80.value"/> |
| <mx:HSlider width="200" value="1" minimum="1" maximum="20" liveDragging="true" id="sz90" change=" ( fc.getElementAt(2) as GraphicElement).scaleZ=sz90.value"/> |
| |
| </mx:VBox> |
| </mx:HBox> |
| <s:Scroller height="180" width="200"> |
| <s:VGroup id="fc" creationComplete="addData()" /> |
| </s:Scroller> |
| </s:Application> |