flex中函数带参数

function.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" fontSize="14">
<mx:Script>
 <![CDATA[
  private function a(word:String):void{
   label1.text=word;
  }
 ]]>
</mx:Script>
 <mx:Label id="label1" width="176" x="360" y="183"></mx:Label>
 <mx:Button id="button1" label="提交" x="360" y="233" click="a('hello the wolrd!')"></mx:Button>
 <mx:Button id="button2" label="提交" x="420" y="233" click="a('the wolrd!')"></mx:Button>
 <mx:Button id="button3" label="提交" x="488" y="233" click="a('侬好!')"></mx:Button>
</mx:Application>

    A+
发布日期:2009年05月19日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: