• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 6. Customizing Objects > INSTANCE-LEVEL PROPERTIES

INSTANCE-LEVEL PROPERTIES

As mentioned in in the previous section, when attempting to access a property value—as when assigning myVariable the value of person1.legs (myVariable = person1.legs; )—ActionScript will always look for the specified property at an instance level first. Only after it’s looked there will ActionScript check the instance’s prototype object. An instance-level property is a property that’s set in the class definition when an instance is created, or it’s a value set by directly addressing the instance. The person1 instance we created in the previous exercise has the following properties:

					name  = "Justin" // instance level
					age = 16 // instance level
					legs = 2 // prototype level
					head = new Object() // prototype level
					head.eyes = 2 // prototype level
					head.memories = new Array() // prototype level
				


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint