-
1. Re: attachMovie radioButton
kglad Nov 26, 2012 7:45 AM (in response to Ron Colmen)what's the trace show:
var yPosition:Number = 0;
ReceiveLoad.onData = function(src) {
var messageA:Array = src.split(",,,");
for(var i:Number=0; i<messageA.length; i++){
var a:Array=messageA[i].split(",,");
_root.radioStage_mc.attachMovie("radioBtns_mc","radioBtn"+i,_root.radi oStage_mc.getNextHighestDepth()); //works
trace(_root.radioStage_mc["radioBtn"+i]);trace(_root.radioStage_mc["radioBtn"+i].radio_btn 3); // if this fails in means you have no object named radio_btn3 in the mc with linkage=radioBtns_mc, when the code executes
_root.radioStage_mc["radioBtn"+i]._y = yPosition;
yPosition = yPosition + 20;
if(a[1]=="Chair"){
trace (a[1]) //output Chair
_root.radioStage_mc["radioBtn"+i].radio_btn3.selected = true;// not working
} else {
_root.radioStage_mc["radioBtn"+i].radio_btn3.selected = false;// not working
}
// _root.radioStage_mc.radioBtn1.radio_btn2.selected = true; //even the direct path is not working??
}
}
-
2. Re: attachMovie radioButton
Ron Colmen Nov 26, 2012 8:29 AM (in response to kglad)Thank you Kglad.
trace output:
_level0.radioStage_mc.radioBtn0
_level0.radioStage_mc.radioBtn0.radio_btn3
_level0.radioStage_mc.radioBtn1
_level0.radioStage_mc.radioBtn1.radio_btn3
_level0.radioStage_mc.radioBtn2
///so on....
-
3. Re: attachMovie radioButton
kglad Nov 26, 2012 9:40 AM (in response to Ron Colmen)then your references are ok and the problem is your array a. (though it's not possible that both if and else branches would be false.)
-
4. Re: attachMovie radioButton
Ron Colmen Nov 26, 2012 12:56 PM (in response to kglad)Thank you Kglad. I'm lost!!
Can you suggest something to overcome the issue?
-
5. Re: attachMovie radioButton
kglad Nov 26, 2012 12:58 PM (in response to Ron Colmen)what is it that you want to happen?
-
6. Re: attachMovie radioButton
Ron Colmen Nov 26, 2012 1:25 PM (in response to kglad)I'm pulling several data from a database. Everything works except for the radio buttons. I would like to be able to make the radio buttons turn on depening on the results received.
-
7. Re: attachMovie radioButton
kglad Nov 26, 2012 1:27 PM (in response to Ron Colmen)what's the following trace show and for each array a item, what do you want to happen to the various radio buttons:
var yPosition:Number = 0;
ReceiveLoad.onData = function(src) {
var messageA:Array = src.split(",,,");
for(var i:Number=0; i<messageA.length; i++){
var a:Array=messageA[i].split(",,");
_root.radioStage_mc.attachMovie("radioBtns_mc","radioBtn"+i,_root.radi oStage_mc.getNextHighestDepth());
_root.radioStage_mc["radioBtn"+i]._y = yPosition;
yPosition = yPosition + 20;
trace(a);
if(a[1]=="Chair"){
_root.radioStage_mc["radioBtn"+i].radio_btn3.selected = true;// not working
} else {
_root.radioStage_mc["radioBtn"+i].radio_btn3.selected = false;// not working
}
// _root.radioStage_mc.radioBtn1.radio_btn2.selected = true; //even the direct path is not working??
}
}
-
8. Re: attachMovie radioButton
Ron Colmen Nov 26, 2012 1:41 PM (in response to kglad)trace output:
yes, Chair, 400, 50
no, Table, 1000, 11
// so on (availability, item, price, quantity)
out of the 3 radio buttons I want
1st radio button to be ON if it's a Table
2nd radio button to be ON if it's a Sofa
and
3rd radio button to be ON if it's a Chair
and if none of the above 3, all radio buttons to be turned OFF.
-
9. Re: attachMovie radioButton
kglad Nov 26, 2012 2:46 PM (in response to kglad)use:
var yPosition:Number = 0;
ReceiveLoad.onData = function(src) {
var messageA:Array = src.split(",,,");
for(var i:Number=0; i<messageA.length; i++){
var a:Array=messageA[i].split(",,");
_root.radioStage_mc.attachMovie("radioBtns_mc","radioBtn"+i,_root.radi oStage_mc.getNextHighestDepth());
_root.radioStage_mc["radioBtn"+i]._y = yPosition;
yPosition = yPosition + 20;
if(a[1]=="Table"){
_root.radioStage_mc["radioBtn"+i].radio_btn1.selected = true;
} else if(a[1]=="Sofa"){
_root.radioStage_mc["radioBtn"+i].radio_btn2.selected = true;
} else if(a[1]=="Chair"){
_root.radioStage_mc.["radioBtn"+i].radio_btn3.selected = true;
}
}
-
10. Re: attachMovie radioButton
Ron Colmen Nov 26, 2012 2:53 PM (in response to kglad)Thank you Kglad.
That did not work. All of the radio buttons were OFF.
-
11. Re: attachMovie radioButton
kglad Nov 26, 2012 4:04 PM (in response to kglad)you may need to delay setting that property:
var yPosition:Number = 0;
ReceiveLoad.onData = function(src) {
var messageA:Array = src.split(",,,");
for(var i:Number=0; i<messageA.length; i++){
var a:Array=messageA[i].split(",,");
_root.radioStage_mc.attachMovie("radioBtns_mc","radioBtn"+i,_root.radi oStage_mc.getNextHighestDepth());
_root.radioStage_mc["radioBtn"+i]._y = yPosition;
yPosition = yPosition + 20;
if(a[1]=="Table"){
setTimeout(setF,100, _root.radioStage_mc["radioBtn"+i].radio_btn1);
} else if(a[1]=="Sofa"){
setTimeout(setF,100,_root.radioStage_mc["radioBtn"+i].radio_btn2);
} else if(a[1]=="Chair"){
setTimeout(setF,100,_root.radioStage_mc.["radioBtn"+i].radio_btn3);
}
}
function setF(rb:RadioButton):Void{
rb.selected=true;
}
-
12. Re: attachMovie radioButton
Ron Colmen Nov 26, 2012 5:35 PM (in response to kglad)That did the trick. Thank you Kglad.
-
13. Re: attachMovie radioButton
kglad Nov 27, 2012 7:06 AM (in response to Ron Colmen)you're welcome.



