jglazener
10-17-2002, 10:43 PM
im just learning actionscript and am totally new to OO prog.
im confused about the more subtle diff. b/w variables and objects and would really be appreciative of anyone's help. thank you.
it seems like at times i can put in a variable any time i want. cant i then, using dot syntax make another variable inside that variable? why would i want to creat an abject?
here is an example of what i dont understand, what is the difference between these scenarios, or is scenario B even possible. this may be a bad example so if it is ill take a more general answer.
//scenario A
suitcase= new Object();
suitcase.billfold=1;
billfold=new Object();
billfold.dollars=0; //darn
//scenario B
_root.suitcase = 1;
_root.suitcase.billfold=1; //can i do this?
_root.suitcase.billfold.bills=0;
im confused about the more subtle diff. b/w variables and objects and would really be appreciative of anyone's help. thank you.
it seems like at times i can put in a variable any time i want. cant i then, using dot syntax make another variable inside that variable? why would i want to creat an abject?
here is an example of what i dont understand, what is the difference between these scenarios, or is scenario B even possible. this may be a bad example so if it is ill take a more general answer.
//scenario A
suitcase= new Object();
suitcase.billfold=1;
billfold=new Object();
billfold.dollars=0; //darn
//scenario B
_root.suitcase = 1;
_root.suitcase.billfold=1; //can i do this?
_root.suitcase.billfold.bills=0;