Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 34

Creating and extending flex 2 components
Hide thumbs Also See for FLEX 2 - CREATING AND EXTENDING COMPONENTS:
Table of Contents

Advertisement

About scope
Scoping is mostly a description of what the
keyword refers to at any given point in your
this
application. In the main MXML application file, the file that contains the
tag, the current scope is the Application object and, therefore, the
<mx:Application>
this
keyword refers to the Application object.
In an ActionScript component, the scope is the component itself and not the application or
other file that references the component. As a result, the
keyword inside the component
this
refers to the component instance and not the Flex Application object.
Nonvisual ActionScript components do not have access to their parent application with the
property. However, you can access the top-level Application object by using
parentDocument
the
property.
mx.core.Application.application
For more information on scope, see Chapter 4, "Using ActionScript," in Flex 2 Developer's
Guide.
34
Using ActionScript to Create Components

Advertisement

Table of Contents
loading

Table of Contents