我真的不明白我做错了什么:这是一个简单的例子,但是当我点击按钮时没有任何反应..
<?xml version="1.0" encoding="utf-8"?>
<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/mx" minWidth="955"minHeight="600">
<fx:Script>
<![CDATA[
private function drawLine():void
{
var myShape:Shape = new Shape();
myShape = new Shape() ;
myShape.graphics.lineStyle(2, 0x990000, .75);
myShape.graphics.moveTo(100, 100);
myShape.graphics.lineTo(25, 45);
this.addChild(myShape);
}
]]>
</fx:Script>
<!--<mx:Label text="Hello World"/>-->
<mx:Button label="Click" click="drawLine()" />
</s:Application>