Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript 1.0/2.0 (http://www.flasher.ru/forum/forumdisplay.php?f=93)
-   -   Как изменить label button`a (http://www.flasher.ru/forum/showthread.php?t=85756)

Slam_VS 29.09.2006 16:13

Как изменить label button`a
 
Собственно сабж???
(mx.controls.Button конечно =))
Вроде как:
Код:

/**
* sets the associated label text
* @tiptext Gets or sets the Button label
* @helpid 3046
*/
        [Inspectable(defaultValue="Button")]
        function set label(lbl:String)
        {
                setLabel(lbl);
        }

/**
* @private
* sets the associated label text
*/
        function setLabel(label:String):Void
        {
                if (label=="")
                {
                        labelPath.removeTextField();
                        refresh();
                        return;
                }

                if (labelPath == undefined)
                {
                        var lp =  createLabel("labelPath", 200, label);
                        lp._width = lp.textWidth + 5;
                        lp._height = lp.textHeight +5;
                       
                        if (initializing)
                                lp.visible = false;
                }
                else
                {
                        delete labelPath.__text;
                        labelPath.text = label;
                        refresh();
                }
        }

(однако)В коде:
Код:

MyButton.setLabel("NEWLABEL");
- ноль имоций ((
P.S. сорри за глупый вопрос конечно :confused:

Хемуль 29.09.2006 16:36

У меня работает...

Slam_VS 29.09.2006 16:41

ОООойй я инициализировал:
Код:

private var MyButton:Button;
Вместо:
Код:

private var MyButton:MovieClip;
...Sorry всем!!!


Часовой пояс GMT +4, время: 13:00.

Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.