actionscript 3 - Mouse event to collision as3 -



actionscript 3 - Mouse event to collision as3 -

hello trying convert as3 code, mouse event code collision event. sorry, don't know in code set other object instance name mcball.

tile1.addeventlistener(mouseevent.click, tileclick); function tileclick(e:mouseevent):void { movieclip(e.currenttarget).gotoandstop(2); if(tile1.currentframe == 1) return; gotoandstop(5); }

thank you.

ok, got working.

firstly made layers 'actions' , 'cont' run 5 frames , copied 'mcpaddle' & 'ball' layer1's (keyframe) on (frame 5).

on actions layer added @ top of code.

var bricksremoved=int(0); var newbricksremoved=bricksremoved; function removebrick(e:event=null):void{ newbricksremoved=newbricksremoved+1; if(newbricksremoved==2) {gotoandstop(5)} } function tracebricksremoved(e:event=null):void{ trace(newbricksremoved); }

and added next code within brick 2, frame 2:

object(root).removebrick(); object(root).tracebricksremoved(); object(root).cont.removechild(this.tile2);

and in brick4, frame 2, added

object(root).removebrick(); object(root).tracebricksremoved(); object(root).cont.removechild(this.tile1);

in case forgot something, upload source server: http://www.dialoz.com/fla_source/break4.fla

actionscript-3 flash mouse collision

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -