Форум Flasher.ru
Ближайшие курсы в Школе RealTime
Список интенсивных курсов: [см.]  
  
Специальные предложения: [см.]  
  
 
Блоги Правила Справка Пользователи Календарь Сообщения за день
 

Вернуться   Форум Flasher.ru > Flash > Общие вопросы о Flash (не затрагивающие ActionScript)

Версия для печати  Отправить по электронной почте    « Предыдущая тема | Следующая тема »  
Опции темы Опции просмотра
 
Создать новую тему Ответ
Старый 21.12.2005, 01:15
Aidhen вне форума Посмотреть профиль Отправить личное сообщение для Aidhen Найти все сообщения от Aidhen
  № 1  
Ответить с цитированием
Aidhen
 
Аватар для Aidhen

Регистрация: Dec 2005
Сообщений: 15
По умолчанию вопрос по 2004 MX Pro - объект ComboBox

^_^
Я тут делаю презентацию небольшую во флэше
и тут возникла проблема
там внутри нужно создать небольшой тестик по пройденному материалу
тест делается след образом
есть объект ComboBox (с именем 1q) и скажем с labelами [ответ1,ответ2,ответ3,ответ4,ответ5], и data [0,0,1,0,0]
есть кнопка check с кодом
on (release)
{

grad.text="здесь нужное значение оценки надо подставить - в чём и проблема";
}

и динам текст grad в который и впихивается ответ
-----------------------------
т.е. на практике все должно работать так: юзер выбирает в combobox ответ(ответы когда вопросов много-и соответственно много comboboxов),
и щелкает на кнопку check - в поле grad высвечивается ответ - в скольких comboboxах были выбранны правильные ответы
--------------------------------
так вот проблема в том - Как мне извлечь из comboboxа необходимый ответ? (то бишь 0 или 1)
--------------------------------
Вчера пару часов угробил...=( что-то я совсем запутался...
-----------------------------
адресация comboboxа относительно кнопки this.1q
помогите а?

Старый 21.12.2005, 01:25
Король вне форума Посмотреть профиль Отправить личное сообщение для Король Найти все сообщения от Король
  № 2  
Ответить с цитированием
Король
 
Аватар для Король

Регистрация: Oct 2003
Адрес: Москва
Сообщений: 2,736
Отправить сообщение для Король с помощью ICQ
getSelectedЧто-точто не помню - смотрим в хелпе

Старый 21.12.2005, 01:56
Aidhen вне форума Посмотреть профиль Отправить личное сообщение для Aidhen Найти все сообщения от Aidhen
  № 3  
Ответить с цитированием
Aidhen
 
Аватар для Aidhen

Регистрация: Dec 2005
Сообщений: 15
открываю хелп смотрю getSelected - определены только для textField =(

вот кстати из хелпа выдранно:

ComboBox class
Inheritance UIObject > UIComponent > ComboBase > ComboBox

ActionScript Class Namespace mx.controls.ComboBox

The ComboBox component combines three separate subcomponents: Button, TextInput, and List. Most of the APIs of each subcomponent are available directly from ComboBox component and are listed in the Method, Property, and Event tables for the ComboBox class.

The drop-down list in a combo box is provided either as an Array or as a DataProvider object. If you use a DataProvider object, the list changes at runtime. The source of the ComboBox data can be changed dynamically by switching to a new Array or DataProvider object.

Items in a combo box list are indexed by position, starting with the number 0. An item can be one of the following:

A primitive data type.
An object that contains a label property and a data property.
Note: An object may use the ComboBox.labelFunction or ComboBox.labelField property to determine the label property.

If the item is a primitive data type other than string, it is converted to a string. If an item is an object, the label property must be a string and the data property can be any ActionScript value.

ComboBox component methods to which you supply items have two parameters, label and data, that refer to the properties above. Methods that return an item return it as an Object.

Each component class has a version property which is a class property. Class properties are only available on the class itself. The version property returns a string that indicates the version of the component. To access the version property, use the following code:

trace(mx.controls.ComboBox.version);

Note: The following code returns undefined: trace(myComboBoxInstance.version);.

Method summary for the ComboBox class
Property
Description

ComboBox.addItem() Adds an item to the end of the list.

ComboBox.addItemAt() Adds an item to the end of the list at the specified index.

ComboBox.close() Closes the drop-down list.

ComboBox.getItemAt() Returns the item at the specified index.

ComboBox.open() Opens the drop-down list.

ComboBox.removeAll() Removes all items in the list.

ComboBox.removeItemAt() Removes an item from the list at the specified location.

ComboBox.replaceItemAt() Replaces an item in the list with another specified item.


Inherits all methods from UIObject class and UIComponent class.

Property summary for the ComboBox class
Property
Description

ComboBox.dataProvider The data model for the items in the list.

ComboBox.dropdown Returns a reference to the List component contained by the combo box.

ComboBox.dropdownWidth The width of the drop-down list, in pixels.

ComboBox.editable Indicates whether or not a combo box is editable.

ComboBox.labelField Indicates which data field to use as the label for the drop-down list.

ComboBox.labelFunction Specifies a function to compute the label field for the drop-down list.

ComboBox.length Read-only. The length of the drop-down list.

ComboBox.rowCount The maximum number of list items to display at one time.

ComboBox.selectedIndex The index of the selected item in the drop-down list.

ComboBox.selectedItem The value of the selected item in the drop-down list.

ComboBox.text The string of the text in the text box.

ComboBox.textField A reference to the TextInput component in the combo box.

ComboBox.value The value of the text box (editable) or drop-down list (static).


Inherits all properties from UIObject class and UIComponent class.

Event summary for the ComboBox class
Event
Description

ComboBox.change Broadcast when the value of the combo box changes as a result of user interaction.

ComboBox.close Broadcast when the drop-down list begins to close.

ComboBox.enter Broadcast when the Enter key is pressed.

ComboBox.itemRollOut Broadcast when the pointer rolls off a drop-down list item.

ComboBox.itemRollOver Broadcast when a drop-down list item is rolled over.

ComboBox.open Broadcast when the drop-down list begins to open.

ComboBox.scroll Broadcast when the drop-down list is scrolled.


Inherits all events from UIObject class and UIComponent class.

Старый 21.12.2005, 02:01
Aidhen вне форума Посмотреть профиль Отправить личное сообщение для Aidhen Найти все сообщения от Aidhen
  № 4  
Ответить с цитированием
Aidhen
 
Аватар для Aidhen

Регистрация: Dec 2005
Сообщений: 15
кстати у меня появилась идея... как справиться с этой проблемой но возник другой вопрос - как переконвертировать формат числа в строковый
(у меня есть подозрение что там просто форматы не совпадают когда я пытаюсь запихать value в text)

Старый 21.12.2005, 15:05
alrusdi вне форума Посмотреть профиль Отправить личное сообщение для alrusdi Найти все сообщения от alrusdi
  № 5  
Ответить с цитированием
alrusdi

Регистрация: Nov 2005
Сообщений: 75
var a = 2005;
var s = a.toString();

Старый 31.12.2005, 04:29
Aidhen вне форума Посмотреть профиль Отправить личное сообщение для Aidhen Найти все сообщения от Aidhen
  № 6  
Ответить с цитированием
Aidhen
 
Аватар для Aidhen

Регистрация: Dec 2005
Сообщений: 15
Ради интереса выложу ответ на эту проблнму, дабы ежели еще кто столкнётся не маялся как я =)
В общем...
Ежели возникают проблемы с компонентами в презентации созданой в 7ых версиях флэша, попробуйте выставить абсолютные адреса вместо относительных... тогда заработает =)
т.е. вместо this.combobox1.value прописываем полностью как оно там звучит _level0.presentation.slide27.slide77.combobox1.value
жутко неудобно зато работает ^_^

Создать новую тему Ответ Часовой пояс GMT +4, время: 14:26.
Быстрый переход
  « Предыдущая тема | Следующая тема »  

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.


 


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


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