AS3 Passing data between objects/classes
Posted
by
1337holiday
on Stack Overflow
See other posts from Stack Overflow
or by 1337holiday
Published on 2010-12-27T23:17:11Z
Indexed on
2010/12/29
4:54 UTC
Read the original article
Hit count: 165
So i a building a categorized menu of different foods. I have a class for "categories" (buttons) which essentially will return a string "salads", "drinks", etc. I now have another class "menuItems" for items within categories and this handles sizes such as "small", "med", "large", etc. My problem now is that when i return "salads", i want to invoke an array which contains all the elements of salads, send it to menuItems which will populate the menu. So far i have both the category objects and the menu object setup. I just cant seem to be able to send the data that the category object is returning and pass it to the menu object. Both of which are added to the stage as shown below:
If there was a way that i could say add all these classes to one class so that they can talk to each other that would be great but i dont know how to do this.
Been stuck for hours, please any help is greatly appreciated.
© Stack Overflow or respective owner