悠索

不要等待机会,而要创造机会。

« 侦听闹钟时间函数scout()为菜单类控件创建事件处理函数 »

以不同的坐标系统跟踪鼠标位置

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

<mx:Script>
<![CDATA[
private function traceMousePosition(event:MouseEvent):void{
 trace(" MouseEvent local position "+event.localX+"  "+event.localY);
 trace(" MousePosition stage position "+event.stageX+"  "+event.stageY);
 trace(" MouseEvent position from w/in component "+this.mouseX+"  "+this.mouseY);
 trace(" Content Mouse Position "+this.contentMouseX+"  "+this.contentMouseY);
}
]]>
</mx:Script>

<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="300" height="500" paddingTop="10" paddingLeft="10" verticalGap="15" click="traceMousePosition(event)" x="96" y="87">
 <mx:Image source="@Embed('assets/01.jpg')"/>
 <mx:Image source="@Embed('assets/02.jpg')"/>
 <mx:Image source="@Embed('assets/03.jpg')"/>
 <mx:Image source="@Embed('assets/04.jpg')"/>
</mx:VBox>

</mx:Application>

 

  • 相关文章:

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

日历

最新评论及回复

最近发表

Copyright (C) 2008-2012 0451sky.com Inc.,All Rights Reserved.