blob: e821f796693b77811e312937d4edcea9ee98e67f [file] [log] [blame]
<?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 xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo" minWidth="1024" minHeight="768">
<s:layout>
<s:BasicLayout/>
</s:layout>
<fx:Script>
<![CDATA[
private function addMatrix(): void
{
ellipse1.transform.matrix = rotation20Matrix;
descriptionText.text = "A matrix transform was applied moving the Ellipse to coordinates: 100, 310 and skewing it to a 20 degree rotation.";
trace(ellipse1.width);
}
]]>
</fx:Script>
<fx:Declarations>
<!-- This matrix should cause the rotation of the Ellipse be 20 degrees -->
<s:Matrix id="rotation20Matrix"
a="0.939692620786"
b="0.34202014332"
c="0.34202014332"
d="0.939692620786"
tx="100"
ty="310"
/>
</fx:Declarations>
<s:SimpleText text="An Ellipse Using a Transform for Rotation" fontWeight="bold" fontSize="14" horizontalCenter="0"
y="20" />
<s:SimpleText id="descriptionText" horizontalCenter="0" y="45" width="300"/>
<s:Ellipse id="ellipse1" width="60" height="70" horizontalCenter="0" y="90">
<s:fill>
<s:LinearGradient>
<s:GradientEntry color="#00FF00" alpha="1" ratio="0"/>
<s:GradientEntry color="#000000" alpha="0" ratio="1"/>
</s:LinearGradient>
</s:fill>
<s:stroke>
<mx:SolidColorStroke color="0x666666" weight="1"/>
</s:stroke>
</s:Ellipse>
<s:Button label="Apply Transform" click="addMatrix()" x="40" y="330" />
</s:Application>