кнопка и гиперссылка в контейнере

То что касается флеша, но не касается ВКонтакте API. Например проблемы при создании прыгающего мячика.
Ответить
drac0Sha
Сообщения: 88
Зарегистрирован: 20 июл 2011, 15:41

кнопка и гиперссылка в контейнере

Сообщение drac0Sha »

Я очень плохо разбираюсь в контейнерах.
подскажите пожалуйста, как добавить в контейнер кнопку и гиперссылку.

Код: Выделить всё

 package  {    import flash.display.Sprite;    import flash.events.Event;    import flash.text.TextField;    import flash.text.TextFormat;    import flash.display.Bitmap;    import flash.events.MouseEvent;    import flash.display.*;    import flash.events.*;    import flash.display.MovieClip;        public class InfoBlock extends Sprite    {        public static const HIDE:String = "hide";        public static const SHOW:String = "show";        private var _info:XML;        private var _mode:uint = 0;        private var _backgroundColor:uint = 0x000000;        private var _backgroundAlpha:Number = 0.24;        private var _blockWidth:Number = 400;        private var _date:IconLabel;        private var _name:IconLabel;        private var _pname:IconLabel;        //private var btn_voice : voice = new voice ();        //private var scene:Sprite = new Sprite();                private var _text:TextField;        private var _labelFormat:TextFormat = new TextFormat("Arial", 11, 0x000000);        private var _textFormat:TextFormat = new TextFormat("Arial", 12, 0x000000);        private var _hiden:Boolean = true;                //private var btn_alive: alive = new alive();                        public function InfoBlock(info:XML)         {            _info = info;            prepare();            setMode(0);            drawBack();                    }                        private function prepare():void        {            _date  = new IconLabel(new Bitmap( new _dateIcon()),  _info..date, _labelFormat);            _name  = new IconLabel(new Bitmap( new _userIcon()),  _info..name, _labelFormat);            _pname = new IconLabel(new Bitmap( new _pnameIcon()),  _info..pname, _labelFormat);                                    this.addChild(_date); _date.x = 10, _date.y = 10;            this.addChild(_name); _name.x = 10, _name.y = 30;            this.addChild(_pname); _pname.x = 10, _pname.y = 50;            //this.addChild(btn_voice); btn_voice.x=20; btn_voice.y=50;            this.addChild(btn_alive); btn_alive.x=10,btn_alive.y=70;             _text = new TextField();            _text.defaultTextFormat = _textFormat;            _text.multiline = true;            _text.wordWrap = true;            _text.width = _blockWidth - 20;            _text.htmlText = _info..address.text()+"\n" + _info..money.text()+"\n"+_info..number.text()+"\n"+_info..comments.text()+"\n"+_info..num_c.text()+"\n"+_info..name_c.text();            _text.height = _text.textHeight + 25;                         //btn_alive.addEventListener(MouseEvent.CLICK,alive );                    }                private function setMode(mode:uint):void        {            if (mode == _mode) return;            if (mode == 0)            {                this.removeChild(_text);                dispatchEvent(new Event(HIDE));            }            else            {                this.addChild(_text);                 _text.x = 10, _text.y = 70;                dispatchEvent(new Event(SHOW));            }            _mode = mode;            drawBack();        }                private function drawBack():void        {            this.graphics.clear();            this.graphics.beginFill(_backgroundColor, _backgroundAlpha);            this.graphics.drawRoundRect(0, 0, _blockWidth, this.height + 20, 12);        }                public function get hiden():Boolean         {            return _hiden;        }                public function set hiden(value:Boolean):void         {            _hiden = value;            setMode(_hiden ? 0 : 1);        }            } } 
здесь у меня происходит создание контейнера, которое потом в main.as при обращении выдаётся.
Ответить