Flash Components      Flash Menu      Flash Gallery      Flash Slideshow      FLV Player      Flash Form      MP3 Player      PhotoFlow      Flash CMS      3D Wall      Flash Scroller

Flash / AS

Silverlight

WPF

ASP.net / PHP

Photoshop

Forums

Blog

About

 


FlashComponents
  Galleries
  Slideshows
  Menus
  Design & Effects
  Audio & Video
  User Interface
  Templates

 

 

 

 


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.

 

 

 
 
 

kirupa.com's fast and reliable hosting provided by Media Temple. flash components
The Text Animation Component for Flash CS3
Check out the great, high-quality flash extensions. Buy or sell stock flash, video, audio and fonts for as little as 50 cents at FlashDen.
Check out our high quality vector-based design packs! Flash Effect Components
flash menus, buttons and components Digicrafts Components
The best flash components ever! Entheos Flash Website Templates
Upload, publish, deliver. Secure hosting for your professional or academic video, presentations & more. Screencast.com Purchase & Download Flash Components
flash components Free Website | Make a Website
Learn how to advertise on kirupa.com