I haven't given this much thought until just now, mistake on my part.
If you plan on having a huge amount of buttons to represent lots of different types of troops, is it better to create individualized buttons / unit type or create all assets in one button and just flip through them with gotoAndStop() in AS?
Scenario:
- Assuming 145 different types of units
Would it be better to create 145 different buttons within the flash file?
OR
Would it be better to create 1 button and inside of it's own onDown, onUp and onOver have 1 frame for each unit, then inside the _root assign event listeners for the different states that switch the frame of this button to show the requested unit of those 145?
Personal thoughts:
145 buttons seems like a lot more resources would be used, but .... doing the gotoAndStop(unit) for every unit's onDown/onUp/onOver would put a strain on the .swf processing.
Right now I'm doing the second method I mentioned and it "feels wrong".
Which of the two methods would you use if you had to do that and why?
If you plan on having a huge amount of buttons to represent lots of different types of troops, is it better to create individualized buttons / unit type or create all assets in one button and just flip through them with gotoAndStop() in AS?
Scenario:
- Assuming 145 different types of units
Would it be better to create 145 different buttons within the flash file?
OR
Would it be better to create 1 button and inside of it's own onDown, onUp and onOver have 1 frame for each unit, then inside the _root assign event listeners for the different states that switch the frame of this button to show the requested unit of those 145?
Personal thoughts:
145 buttons seems like a lot more resources would be used, but .... doing the gotoAndStop(unit) for every unit's onDown/onUp/onOver would put a strain on the .swf processing.
Right now I'm doing the second method I mentioned and it "feels wrong".
Which of the two methods would you use if you had to do that and why?