Chaotic lines | ActionScript3自动画线_笔记
This site is a portfolio of Ray . Hope you enjoy it!
故事板,分镜头,storyboard,电影分镜,分镜师,storyboard artist
3116
post-template-default,single,single-post,postid-3116,single-format-standard,ajax_updown_fade,page_not_loaded,,qode-child-theme-ver-1.0.0,qode-theme-ver-3.6,wpb-js-composer js-comp-ver-5.4.2,vc_responsive
 

Blog

ActionScript3自动画线_笔记

  |   Geek   |   No comment

actionscript3

随路径自动画线,

逐帧侦听函数:
addEventListener(Event.ENTER_FRAME,addfrog);

画线:
graphics.lineStyle(宽度,颜色);
graphics.moveTo(起点坐标);
graphics.lineTo(终点坐标);

如需删除所生成的线条,使用    graphics.clear();

舞台需要”box”影片剪辑..用来做路径动画.
库需要”RR_shape1″的影片剪辑.用来逐帧打点.

var myMC:Sprite;
var Ary:Array = new Array  ;
var myMC1:Sprite;
addEventListener(Event.ENTER_FRAME,addfrog);
function addfrog(e:Event):void
{
    var r1=new RR_shape1();
    addChild(r1);
    r1.x = box.x;
    r1.y = box.y;
    myMC = r1;
    Ary.push(myMC);
    if (Ary.length > 1)
    {
        graphics.lineStyle(12,0x123456);
        graphics.moveTo(Ary[Ary.length-2].x,Ary[Ary.length-2].y);
        graphics.lineTo(Ary[Ary.length-1].x,Ary[Ary.length-1].y);
    }

}
No Comments

Post A Comment