MINI SUPPORTERS:

 

 

 

 


AS1 OOP: Object Scope
         by senocular  

Introduction
Probably one of the more difficult concepts to understand in Actionscript, especially when first learning it, is correctly referencing variable or object scope. A scope refers to the referenceable place where variables and objects exist. The scope itself refers to the containing object, of where variables can be defined. The way you would differentiate between a num property contained within 2 different objects is through each objects own unique scope. The property is num in both objects, but since there are 2 different objects, there are 2 different num properties (2 different scopes).

firstObject = {num: 1};
secondObject = {num: 10};
trace(firstObject.num); // traces 1
trace(secondObject.num); // traces 10

So scope, for the most part, refers to which object.

 

 

 
 
 
SUPPORTERS:

cloud storage
cloud storage
kirupa.com's fast and reliable hosting provided by Media Temple. Creative web apps. Make your own free flash banners and photo slideshows.
HTML5 CSS3 Mobile Gallery for iPhone, iPad Flash effects. Art without coding.
Flipping Book - page flip flash component. Flash-Gallery.com - Get your flash photo gallery (flash component or swf gallery
X-Platform Application Development for Flash Free Flash Components Download - XML Templates, Players and Galleries.

two computer monitors

US Direct

Learn how to advertise on kirupa.com  
 
SHARE:



MINI SUPPORTERS: