Просмотр полной версии : код для определения галочка в Checkbox
andrew1986
27.05.2009, 15:58
Поскажите как правильно писать код для определения стоит ли галочка в checkbox?
Эм.. ради такого в хелп наверное быстрей будет заглянуть:
if (checkBox.selected) {}
_root.onEnterFrame=function() {
if (box1.selected==true) {
info.text="box1";
}
if (box2.selected==true) {
info.text="box2";
}
if (box3.selected==true) {
info.text="box3";
}
}
_root.onEnterFrame=function() {
if (box1.selected==true) {
info.text="box1";
}
if (box2.selected==true) {
info.text="box2";
}
if (box3.selected==true) {
info.text="box3";
}
}
Это что, пример из разряда, как делать не надо?
this.createEmptyMovieClip("square_mc",this.getNextHighestDepth());
square_mc.beginFill(0xFF0000);
square_mc.moveTo(10,10);
square_mc.lineTo(100,10);
square_mc.lineTo(100,100);
square_mc.lineTo(10,100);
square_mc.endFill();
//Создали чекБокс
this.createClassObject(mx.controls.CheckBox,"checkBox",1,{label:"Альфа", labelPlacement:"right"});
checkBox.move(150,10);
var myListener:Object = new Object();
myListener.click = function(evt_obj:Object) {
if (evt_obj.target.selected) {
square_mc._alpha = 50;
} else {
square_mc._alpha = 100;
}
};
checkBox.addEventListener("click",myListener);
Считайте как хотите... =) Я реализовывал опрос данным способом. Производительность меня устраивала...
Работает на vBulletin ® версия 3.7.3. Copyright ©2000-2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Copyright © 1999-2008 Flasher.ru. All rights reserved.