并联电路
package { import flash.display.MovieClip; import flash.events.MouseEvent; import flash.events.Event;
/*
*author : SinSoul
*blogs: http://www.cnblogs.com/sinsoul
*/
public class binlian extends MovieClip { public function binlian() { a1.addEventListener(MouseEvent.CLICK,dong); a2.addEventListener(MouseEvent.CLICK,dong); addEventListener(Event.ENTER_FRAME,onEvent); } function zhuan(e:Event):void { a.rotation=a.rotation+10; } function dong(e:MouseEvent):void { e.currentTarget.play(); } function onEvent(e:Event):void { if (a1.currentFrame==1&&a2.currentFrame==1) { addEventListener(Event.ENTER_FRAME,zhuan); } else { removeEventListener(Event.ENTER_FRAME,zhuan); } } } }