Make Running Horse code

Source: Internet
Author: User
Tags addchild

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=["Ma ' am, you go slow." Singing: Dedema "," "Lyrics editor: Liu Bong qq:406663870", "Horse ah you slow down a little walk", "I want to see enough of this magnificent scenery," "Socialist Construction Changed the world", " The work song rang the field through the hills, "" "," never seen a team of cars go in the clouds, "have not seen thousands of miles of plains running Iron cow," not seen in the water rolling mountains around, "" never seen drought waterlogging bumper harvest "," have not seen mountains repair factory "," did not see the highway to deep ravine ditch "," "," Hey, MA ' am, slow down, slow down, go. "I'm going to see enough of this great scene," The wind blew that rice and wheat rolled up thousand heavy waves, "" "", "" "," "" "," "Green Grass cattle and sheep flock to go," the new reservoir in the fish to swim heartily, "" farmyard male and female militia practicing martial arts "," The cadres and members of the field waved the hoe. Eyes looking at the new mountain new water, "How not to teach people to laugh in the face," "Happy Heart Head Happy Heart", "Ah Motherland I love your magnificent scenery", "I want to see a general enough to see enough", "" ";

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));

}

= = = Horse

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;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.