Note that there are some explanatory texts on larger screens.

plurals
  1. USMyk
    primarykey
    data
    text
    plurals
    1. COI get the gist of what you're saying, no worries about formatting. The answer isn't really cut and dry - I mean there are a million ways to do things - but generally speaking when you have a hierarchical object like that then instance variables are a solid approach. Your car can have a member "Dashboard" which in turn has members "Speedometer" and "Radio", etc. There are other ways to approach the problem - you could have a ComponentManager class, or a CarPartsPool that only instantiates objects when you need them - but that's a higher level architectural discussion.
      singulars
    2. CODepending on your degree of competence and comfort level with advanced programming concepts, you might want to consider an MVC approach using something like PureMVC. MVC Frameworks are designed to allow you to add something like for instance a window knob without having to go back and reprogram your car to listen for it. Basically, all logic is separated out from the visual parts of your car. Your display elements become little more than bitmaps, and an abstract Controller listens for their events and then directs them. Learn more here: http://puremvc.org/
      singulars
    3. COmyObject.name will only work if A) myObject is on stage and has an instance name or if B) you manually set myObject.name somewhere previously. .name is a string property of any DisplayObject, I believe. It's there for better integration into the Flash IDE (ie so you can put stuff on stage) or for specific cases where you need to name stuff so you can use getChildByName(). Still, glad that helps! It's much easier to just use the + operator to assembly complex strings in Flash. Cheers!
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload