home *** CD-ROM | disk | FTP | other *** search
- package
- {
- import flash.display.MovieClip;
- import flash.display.SimpleButton;
- import flash.display.Sprite;
- import flash.geom.ColorTransform;
- import flash.text.TextField;
-
- public class TileButton extends Sprite
- {
-
- protected static var Gfx:Class = TileButton_Gfx;
-
-
- public var level:int;
-
- private var lLight:MovieClip;
-
- private var rLight:MovieClip;
-
- private var button:SimpleButton;
-
- private var lTunnel:Sprite;
-
- private var center:Sprite;
-
- private var rTunnel:Sprite;
-
- private var label:TextField;
-
- public function TileButton(param1:int, param2:ColorTransform)
- {
- super();
- this.level = param1;
- var _loc3_:Sprite = new Gfx();
- while(_loc3_.numChildren)
- {
- addChild(_loc3_.getChildAt(0));
- }
- button = getChildByName("button") as SimpleButton;
- label = getChildByName("label") as TextField;
- center = getChildByName("center") as Sprite;
- lTunnel = getChildByName("lTunnel") as Sprite;
- rTunnel = getChildByName("rTunnel") as Sprite;
- lLight = lTunnel.getChildByName("light") as MovieClip;
- rLight = rTunnel.getChildByName("light") as MovieClip;
- label.mouseEnabled = false;
- center.mouseEnabled = false;
- lTunnel.mouseEnabled = false;
- rTunnel.mouseChildren = false;
- lLight.gotoAndStop(2);
- rLight.gotoAndStop(2);
- lLight.transform.colorTransform = param2;
- rLight.transform.colorTransform = param2;
- label.text = "" + param1;
- removeChild(center);
- removeChild(lTunnel);
- removeChild(rTunnel);
- }
-
- public function addLeft() : void
- {
- addChild(lTunnel);
- }
-
- public function complete() : void
- {
- addChild(center);
- if(label.parent == this)
- {
- removeChild(label);
- }
- }
-
- public function addRight() : void
- {
- addChild(rTunnel);
- }
- }
- }
-