Var spríte2

299 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
299
On SlideShare
0
From Embeds
0
Number of Embeds
33
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Var spríte2

  1. 1. var sprite1:Sprite=new Sprite();sprite1.graphics.lineStyle (4,0xff9900);sprite1.graphics.beginFill (0x000099);sprite1.graphics.drawRect (0, 0,250,250);addChild(sprite1);sprite1.x=50;sprite1.y=50;Var spríte2: Sprite=new Sprite();spríte2.graphics.lineStyle (6,0xff9900);spríte2.graphics.beginFill (0x000030);spríte2.graphics.drawRect (0, 0,250,250);addChild (spríte1);spríte2.x=150;spríte2.y=50;
  2. 2. var sprite3:Sprite=new Sprite();sprite3.graphics.lineStyle(2,0x000000);sprite3.graphics.beginFill(0xcccc00);sprite3.graphics.drawCircle(0,0,25);sprite3.x=125; //la posicion es relativa al spritesprite3.y=125;sprite1.addChild(sprite3);//en el sprite1 colocamos el sprite3Este código nos sirve para que la bolita pase de cuadro a cuadrosprite1.addEventListener (MouseEvent.CLICK, pulsar sprite);sprite2.addEventListener (MouseEvent.CLICK, pulsarsprite);functionpulsarsprite (event: MouseEvent){event.currentTarget.addChild(sprite3);}

×