论坛交流
首页办公自动化| 网页制作| 平面设计| 动画制作| 数据库开发| 程序设计| 全部视频教程
应用视频: Windows | Word2007 | Excel2007 | PowerPoint2007 | Dreamweaver 8 | Fireworks 8 | Flash 8 | Photoshop cs | CorelDraw 12
编程视频: C语言视频教程 | HTML | Div+Css布局 | Javascript | Access数据库 | Asp | Sql Server数据库Asp.net  | Flash AS
当前位置 > 文字教程 > Flash AS教程
Tag:2.0,3.0菜鸟,游戏,,cs,技巧,源码,,文本,文字,函数,音乐,随机,拖拽,asp,access,xml,mc,视频教程

Flash AS制作奔跑的骏马

文章类别:Flash AS | 发表日期:2010-4-28 14:46:19

看看效果:


详细代码:

var n:uint=0;

var mysp:Sprite=new Sprite();

mysp.y=80;

addChild(mysp);

for (var i:uint=0; i<4; i++) {

        var picmc:MovieClip=new Pic();

        picmc.x=i*picmc.width;

        picmc.scaleX=Math.pow(-1,i);

        mysp.addChild(picmc);

}

var pnkcy:Sound=new Pnyqkcy();

var pnkCh:SoundChannel=new SoundChannel();

var ps:Boolean=true;

plst_mc.buttonMode=true;

plst_mc.addEventListener(MouseEvent.CLICK,plst);

function plst(ev:MouseEvent):void {

        if (ps) {

                addEventListener(Event.ENTER_FRAME,gctb);

                pnkCh=pnkcy.play();

                mp.play();

                mp1.play();

                plst_mc.gotoAndStop(2);

        } else {

                removeEventListener(Event.ENTER_FRAME,gctb);

                n=0;

                pnkCh.stop();

                mp.stop();

                mp1.stop();

                plst_mc.gotoAndStop(1);

        }

        ps=! ps;

}

var sj:Array=[1560,3560,5560,10600,23000,35000,43050,59810,71240,80370,89470,93930,98240,108479,122280,132360,146530,
158160,166630,181080,196250,206060,216840,220120,224360,239720,243170,262440,271060,290250

];

var gc:Array=["马儿啊你慢些走","演唱:德德玛","歌词编辑:刘朋 QQ:406663870","马儿啊你慢些走慢些走哎","我要把这壮丽的景色看个够","社会主义建设改换了天地","劳动歌声响遍了田野响彻了山头","","没见过一队队汽车云中走","没见过千里平川跑铁牛","没见过渠水滚滚山上绕","没见过天旱水涝保丰收","没见过深山密林修工厂","没见过公路通到深山沟深山沟","","马儿啊你慢些走慢些走哎","我要把这大好的风光看个够","风吹那稻麦卷起了千重浪","漫山遍野沉甸甸果实压弯了枝头","","碧绿的草地上牛羊成群走","新修的水库中鱼儿尽情游","场院上男女民兵练武艺","田野里干部社员同挥锄头","眼望着新山新水新气象","怎不教人笑在脸上","喜在心头喜在心头","哎祖国啊我爱你壮丽的景色","我想看个够总也看不够",""];

function gctb(ev:Event):void {

        if (mysp.x>-2*picmc.width) {

                mysp.x-=5;

        } else {

                mysp.x=0;

        }

        if (pnkCh.position>=sj[n+1]) {

                n++;

        }

        gca_txt.text=gc[n];

        var gcb:String=gc[n];

        gcb_txt.text=gcb.substring(0,(gcb.length+2)*(pnkCh.position-sj[n])/(sj[n+1]-sj[n]));

}

//====马

var mp:MovieClip=new Mp();

addChild(mp);

mp.x=200;

mp.y=200;

mp.scaleX=0.5;

mp.scaleY=0.5;

var mp1:MovieClip=new Mp1();

addChild(mp1);

mp1.x=150;

mp1.y=200;

mp1.scaleX=0.45;

mp1.scaleY=0.45;

视频教程列表
文章教程搜索
 
Flash AS推荐教程
Flash AS热门教程
看全部视频教程
购买方式/价格
购买视频教程: 咨询客服
tel:15972130058