View Full Version : __global.variable != dynamic box variable?
eggnogg
05-24-2003, 05:26 PM
_global.cash = combo.getSelectedItem().label
retrieves the combo's label and assigns it to the _global.cash
if i create a dynamic text box, with it's variable set to "cash", on frame 2, why dosent it display the value of the _global.cash variable, set on frame 1?
_global.var is diferent than the variable defined in a dynamic box? :confused:
regards
eggnogg
Fugee
05-24-2003, 05:32 PM
Try setting this:
myField.text = _global.cash;
works better than with vars!
CyanBlue
05-24-2003, 05:36 PM
Oops... Fugee is faster... :)
I think I remember reading a thread that goes similar to this...
The sum of that thread was that _global variable does not exist properly when it is to be assigned to the text field variable or something like that... Yet, this worked, if I remember correctly..._global.cash = combo.getSelectedItem().label
_root.anothercash = _global.cash;
textFieldVariable = _root.anothercash;That's the point that I am trying to say here...
Anyways... Yup... !00% agreed with Fugee...
Do not use text field variable if you use FMX unless you are exporting the movie to F5... That space for the text field variable is there for the backward compatibility, and no other reason... ;)
eggnogg
05-24-2003, 06:01 PM
heya guys
_global.cash = combo.getSelectedItem().label
_root.anothercash = _global.cash;
textFieldVariable = _root.anothercash;
works fine!
:)
here's the fla, just for the sake of it ;)
my problem isnt over yet though, bcause in the real app im making i have not 1 combo box, but 24 of those little fellas!
ouch! is it a good ideia to work on a script based on functions?
regards and thx in advance
eggnogg
eggnogg
05-24-2003, 06:38 PM
yep, functions are a crazy thing!
_parent.combo1.setSelectedIndex(_parent.combo1.get SelectedItem());
_parent.b1 = _root.page2.form.combo1.getSelectedItem().data;
this is code without functions!
and then functions appeared!! i first declared this function in frame 1:
function calc(FComboBox, variable)
{
_parent.FComboBox.setSelectedIndex(_parent.FComboB ox.getSelectedItem());
_parent.variable = _root.page2.form.FComboBox.getSelectedItem().data;
}
then, in frame 2 i have the following:
calc1(combo1, b1);
why the hell dosent this work? :p
regards
eggnogg
Fugee
05-24-2003, 06:43 PM
Try this:
function calc(path, FComboBox, variable)
{
path.FComboBox.setSelectedIndex(_parent.FComboBox. getSelectedItem());
path.variable = _root.page2.form.FComboBox.getSelectedItem().data;
}
and when you recall it this:
calc1(_parent, combo1, b1);
eggnogg
05-27-2003, 11:39 AM
heya fugee...
dosent work :/ the next piece of code is turning out to be very tricky and seems to limit the options i have to "play around" with the comboBox. :/
_parent.combo1.setSelectedIndex(_parent.combo1.get SelectedItem());
_parent.b1 = _root.page2.form.combo1.getSelectedItem().data;
the above piece of code is in a 2 framed loop MC that autoselects an item from the comboBox.
but if i equal the variable varCombo1 to _parent.combo1.getSelectedItem(); in another frame it dosent work properly ... :/ all it gets is "- - -" (the first item of the comboBox), even though in reallity the comboBox is set to the third item in the list "disc".
anyone dominates components?
regards
eggnogg
Fugee
05-27-2003, 03:53 PM
don't know now 'cause i haven't got flash here but maybe your problem is here:
_parent.FComboBox.setSelectedIndex(_parent.FComboB ox.getSelectedItem());
do you know if that _parent relates to your FComboBox or to the function?
try using full path instead of the the relative ones...maybe it will work...
also try with and without that _parent/full path in the function
i'll experiment with it tonight and let you know ;)
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.