收集的小效果

//飞碟
import
flash.display.Sprite; import flash.utils.Timer; import flash.events.TimerEvent; var B:Sprite=new Sprite(); addChild(B); B.x = stage.stageWidth / 2; B.y = stage.stageHeight / 2; for (var i:int=0; i<9; i++) { var bg:Sprite=new Sprite(); addChild(bg); bg.graphics.drawCircle(0,0,400); bg.x = 200; bg.y = i * 20; for (var j:int=0; j<=36; j++) { bg.graphics.beginFill(Math.random()*0xFFFFFF); i<5?bg.graphics.drawCircle(i*50*Math.cos(Math.PI/180*j*10),i*50*Math.sin(Math.PI/180*j*10),5):bg.graphics.drawCircle((8-i)*50*Math.cos(Math.PI/180*j*10),(8-i)*50*Math.sin(Math.PI/180*j*10),5); bg.graphics.endFill(); } bg.rotationX = -80; B.addChild(bg); } var timer:Timer = new Timer(50); timer.start(); timer.addEventListener(TimerEvent.TIMER,timerhs); function timerhs(ev:TimerEvent):void { B.rotationY -= 5; B.rotationX -= 2; ev.updateAfterEvent(); }

效果二:八卦图

import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.display.Sprite;
import flash.geom.Point;
import flash.filters.GlowFilter;


var sp:Sprite=new Sprite(),ro:int=90;
sp.x = stage.stageWidth / 2,sp.y = stage.stageHeight / 2;
addChild(sp);
sp.graphics.lineStyle(20,0x666666);
sp.graphics.moveTo(0,200);
var tA:Timer = new Timer(10);
tA.start();
tA.addEventListener(TimerEvent.TIMER,ontArun);
function ontArun(ev:TimerEvent):void
{
        if (tA.currentCount <= 180)
        {
                sp.graphics.lineTo(200*Math.cos(Math.PI/180*ro),200*Math.sin(Math.PI/180*ro));
        }
        else if (tA.currentCount<=270)
        {
                sp.graphics.lineTo(100*Math.cos(Math.PI/180*ro),100+100*Math.sin(Math.PI/180*ro));
        }
        else if (tA.currentCount <=360)
        {
                sp.graphics.lineTo(100*Math.cos(Math.PI/180*ro),-100+100*Math.sin(Math.PI/180*-ro));
        }
        if (tA.currentCount == 400)
        {
                sp.graphics.drawCircle(0,-100,10);
                sp.graphics.drawCircle(0,100,10);
        }
        ro +=  2;
        sp.rotation +=  5;
        ev.updateAfterEvent();
}

转载于:https://www.cnblogs.com/flashweb/archive/2012/12/01/2797277.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值