Форум 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)
-   -   Как разместить выпадающее меню в определенном месте и заполнить его? (http://www.flasher.ru/forum/showthread.php?t=113901)

BangMan 12.07.2008 23:24

Как разместить выпадающее меню в определенном месте и заполнить его?
 
Здравствуйте, подскажите, пожалуйста, возможно ли выпадающее меню создать наподобие того, как создается текстовое поле:
Код:

this.createTextField("pole", 0, 543, 210, 100, 20);
pole.type = "input";
pole.text = "Что искть?";

то есть задать место, где оно будет располагаться, текст по умолчанию и т.д.
Пробовал встроенный хелп юзать...там про какие-то два файла пишут, создал я их, разместил, а дальше что?...Надеюсь на понимание и помощь.

scarbo 12.07.2008 23:37

Можно,а опишите подробно,как Вы менюшку делаете?

BangMan 12.07.2008 23:44

Вот по этому материалу встроенного хелпа пробовал, не вышло:


Example
The following example uses the JavaScript API to create a new command that appears on the Commands menu. Create two files, as described in this section, and place them in your Commands folder in your user-level configuration folder. For more information, see Configuration folders installed with Flash in Getting Started with Flash.

First, create a file named skew.jsfl and place it in your Commands folder. Place the following code into the file and save the file:

Код:

// Create an XML to UI dialog box using the XML definition in the skew.xml file
var skewDlg = fl.getDocumentDOM().xmlPanel( fl.configURI + "Commands/skew.xml" );

// Place the values of xskew and yskew from the dialog box into local variables.
// Note that we cast (convert) the return value of skewDlg["xSkew"] to a number before assigning
// it to xSkew because the skewSelection method takes numbers as parameters.
var xSkew = Number(skewDlg.xSkew);
var ySkew = Number(skewDlg.ySkew);
var edge = skewDlg.edge;

if (skewDlg.dismiss == "accept") {

    // Place the values of xSkew and ySkew from the dialog box
    // into local variables. The code casts (converts) the values from the
    // dialog box to a number before assigning them to the local variables
    // because the skewSelection() method takes numbers for
    // the xSkew and ySkew parameters.
    var xSkew = Number(skewDlg.xSkew);
    var ySkew = Number(skewDlg.ySkew);
    var edge    = skewDlg.edge;

    // check for valid input because sending 0 or undefined to
    // skewSelection() will cause the object to disappear.
    var inputIsValid = true;
    if (xSkew == 0 || isNaN(xSkew)) {
        inputIsValid = false;
    }
    if (ySkew == 0 || isNaN(ySkew)) {
        inputIsValid = false;
    }

    // Call skewSelection() to carry out the resizing command.
    if (inputIsValid ) {
        fl.getDocumentDOM().skewSelection(xSkew, ySkew, edge);
    }
}

Second, create a file named skew.xml and place it in your Commands folder. Place the following code into the file and save the file:

Код:

<dialog id="skew-dialog" title="Skew Selection" buttons="accept, cancel">
    <grid>
        <columns>
            <column/>
            <column/>
        </columns>
        <rows>
            <row align="left">
                <label value="Skew x: " control="xSkew" align="left"/>
                <popupslider id="xSkew" minvalue="-180" maxvalue="180"/>
            </row>
            <row align="left">
                <label value="Skew y:" control="ySkew" align="left"/>
                <popupslider id="ySkew" minvalue="-180" maxvalue="180"/>
            </row>
            <row align="left">
                <label value="Edge:" control="edge" align="left"/>
                <menulist id="edge">
                    <menupop>
                        <menuitem label="top center"/>
                        <menuitem label="right center"/>
                        <menuitem label="bottom center"/>
                        <menuitem label="left center"/>
                    </menupop>
                </menulist>
            </row>
        </rows>
    </grid>
</dialog>

The skew command now appears on the Commands menu. Draw a shape on the Stage, then select it with the pointer tool. If you then select the skew command from the Commands menu, the dialog box defined by skew.xml appears, as shown in the following figure:

scarbo 12.07.2008 23:51

Честно говоря,ни чё не понял,тут какие -то разные коды намешаны,и вообще оформляйте свои посты тегами Code ,иначе от модераторов попадет
Постарайтесь привести более читабельный код

BangMan 13.07.2008 00:00

Вообще это все, что я мог найти по ВЫПАДАЮЩИМ МЕНЮ в хелпе :( а надо-то просто помощь знающих людей в написании кода, более понятного, с этим я сам не совсем разобраться могу :))
Ну неужели никто не делал выпадающее меню с вариантами выбора чего-нибудь?

Wolsh 13.07.2008 00:10

BangMan, это вообщето JSFL, язык для управления интерфейсом самой программы Флэш))))
Для создания своих собственных инструментов, элементов в интерфейсе, команд меню в частности.

BangMan 13.07.2008 00:31

:) я и подумал, что что-то тут не ладно :) так а собственное выпадающее меню со списком мувов, так же просто как и текстовое поле можно создать самому?

scarbo 13.07.2008 00:33

конечно,попробуйте,а потом после попыток код в студию


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

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