kali ini Pustaka Flash mencoba memberikan scripth dasar Pengenalan mouse event as3
- Mouse event klick scripth yang dipergunakan
- Mouse event down scripth yang dipergunakan
- Mouse event down plus up scripth yang dipergunakan
- Mouse event Rollover dan Rollout scripth yang dipergunakan
- Mouse event double cick scripth yang dipergunakan
tombol.addEventListener(MouseEvent.CLICK,mousediklik); function mousediklik(e:MouseEvent):void{ //keadaan yang diinginkan }contoh penerapan
tombol.addEventListener(MouseEvent.CLICK,mousediklik); function mousediklik(e:MouseEvent):void{ isiteks.text="mouse diklik";//keadaan yang diinginkan }hasil:
tombol.addEventListener(MouseEvent.MOUSE_DOWN,mousedown); function mousedown(e:MouseEvent):void{ //keadaan yang diinginkan }contoh penerapan
tombol.addEventListener(MouseEvent.MOUSE_DOWN,mousedown); function mousedown(e:MouseEvent):void{ isiteks.text="tombol ditekan"; }hasil:
tombol.addEventListener(MouseEvent.MOUSE_DOWN,mousedown); function mousedown(e:MouseEvent):void{ //keadaan yang diinginkan } tombol.addEventListener(MouseEvent.MOUSE_UP,mouseup); function mouseup(e:MouseEvent):void{ //keadaan yang diinginkan }contoh penerapan
tombol.addEventListener(MouseEvent.MOUSE_DOWN,mousedown); function mousedown(e:MouseEvent):void{ isiteks.text="tombol ditekan"; } tombol.addEventListener(MouseEvent.MOUSE_UP,mouseup); function mouseup(e:MouseEvent):void{ isiteks.text="tombol dilepas dr tekanan"; }hasil:
tombol.addEventListener(MouseEvent.ROLL_OVER,rollover); function rollover(e:MouseEvent):void{ //keadaan yang diinginkan } tombol.addEventListener(MouseEvent.ROLL_OUT,rolout); function rolout(e:MouseEvent):void{ //keadaan yang diinginkan }contoh penerapan
tombol.addEventListener(MouseEvent.ROLL_OVER,rollover); function rollover(e:MouseEvent):void{ isiteks.text="tombol dirolover"; } tombol.addEventListener(MouseEvent.ROLL_OUT,rolout); function rolout(e:MouseEvent):void{ isiteks.text="tombol dirolout"; }hasil:
tombol.doubleClickEnabled = true; tombol.addEventListener(MouseEvent.DOUBLE_CLICK,onMouseDoubleClick); function onMouseDoubleClick(e:MouseEvent):void{ //keadaan yang diinginkan }contoh penerapan
tombol.doubleClickEnabled = true; tombol.addEventListener(MouseEvent.DOUBLE_CLICK,onMouseDoubleClick); function onMouseDoubleClick(e:MouseEvent):void{ isiteks.text="tombol diklik 2 kali"; }hasil:
0 komentar:
Post a Comment