Flash as中多种效果按钮的制作
Flash as 多种效果按钮的制作。就是在鼠标不接触他的时候透明度为40%,鼠标放上去以后透明度稳定匀速提高到80%。离开后又稳定匀速下降到40%。
就是 MAIN PAGE
ABOUT ME
PHOTO PORTFOFIO
CONTACTS
这几个按钮的效果。
代码:
package
{
import gs.TweenLite;
import flash.display.Sprite;
import flash.events.MouseEvent;
/**
* ...
* @author FLASH023
*/
public class LVPbutton extends Sprite
{
public function LVPbutton(_c:uint=0x666666):void {
alpha = .4;
graphics.beginFill (_c);
graphics.drawRect (0, 0, 100, 66);
buttonMode = true;
addEventListener (MouseEvent.MOUSE_OVER , mouseOverHandler);
addEventListener(MouseEvent.MOUSE_OUT , mouseOutHandler );
}
private function mouseOverHandler(_evt:MouseEvent ):void {
TweenLite.to(this, .6, { alpha:.8 } );
}
private function mouseOutHandler(_evt:MouseEvent ):void {
TweenLite.to(this, .6, { alpha:.4 } );
}
}
}
复制内容到剪贴板代码:
package
{
import flash.display.Sprite;
/**
* ...
* @author FLASH023
*/
public class Main extends Sprite
{
public function Main():void {
var _p:uint = 3;
while(_p--){
var _btn:LVPbutton = new LVPbutton(Math.random ()*0xFFFFFF) ;
_btn.x = 50+_p * 120;
_btn.y = 200;
addChild (_btn);
}
}
}
}
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |