<< Chapter < Page Chapter >> Page >
Learn how to create a custom effect and how to play it two different ways.
Click CustomEffect02 or CustomEffect03 to run the ActionScript programs from this lesson. (Click the "Back" button in your browser to return to this page.)

Table of contents

Preface

General

All references to ActionScript in this lesson arereferences to version 3 or later.

This tutorial lesson is part of a series of lessons dedicated to object-oriented programming(OOP) with ActionScript.

Several ways to create and launch ActionScript programs

There are several ways to create and launch programs written in the ActionScript programming language.Many of the lessons in this series will use Adobe Flex as the launch pad for the sample ActionScript programs.

An earlier lesson titled The Default Application Container provided information on how to get started programming with Adobe's Flex Builder 3. (See Baldwin's Flex programming website .) You should study that lesson before embarking on the lessons in this series.

Some understanding of Flex MXML will be required

I also recommend that you study all of the lessons on Baldwin's Flex programming website in parallel withyour study of these ActionScript lessons. Eventually you will probably need to understand both ActionScript and Flex and the relationships that exist betweenthem in order to become a successful ActionScript programmer.

Will emphasize ActionScript code

It is often possible to useeither ActionScript code or Flex MXML code to achieve the same result. Insofar as this series of lessons is concerned, the emphasis will be on ActionScriptcode even in those cases where Flex MXML code may be a suitable alternative.

Viewing tip

I recommend that you open another copy of this document in a separate browser window and use the followinglinks to easily find and view the figures and listings while you are reading about them.

Figures

  • Figure 1 . Program output at startup.
  • Figure 2 . CustomEffect02 output after clicking a button.

Listings

  • Listing 1 . Common MXML Code.
  • Listing 2 . Beginning of the class named CustomEffect.
  • Listing 3 . The constructor for the class named CustomEffect.
  • Listing 4 . Override the initInstance method.
  • Listing 5 . Override the getAffectedProperties method.
  • Listing 6 . Beginning of the CustomEffectInstance class.
  • Listing 7 . Declare variables for storage of effect properties.
  • Listing 8 . The constructor for the CustomEffectInstance class.
  • Listing 9 . Override the inherited play method.
  • Listing 10 . Play the three effects in parallel.
  • Listing 11 . Beginning of the Driver class for CustomEffect02.
  • Listing 12 . Beginning of the constructor for the Driver class.
  • Listing 13 . Set properties on the custom effect.
  • Listing 14 . The common click event handler.
  • Listing 15 . Beginning of the Driver class for CustomEffect03.
  • Listing 16 . Set properties on the custom effect.
  • Listing 17 . Apply the effect to the two buttons individually.
  • Listing 18 . Common MXML code used for both programs.
  • Listing 19 . Source code for the class named CustomEffect.
  • Listing 20 . Source code for the class named CustomEffectInstance.
  • Listing 21 . Driver class for the program named CustomEffect02.
  • Listing 22 . Driver class for the program named CustomEffect03.

Questions & Answers

it is the situation where by im a market there is only one supplier and producer of a certain comodity that has no close substitute or competitor
Sepiso Reply
yes
Alhaji
what is demand and supply
Alhaji
what is Economics?
Pintu Reply
Is the study of human behaviour as a relationship between ends and scares mean which have alternative use
Alhaji
yes
Tawa
what is monopoly
Alhaji
what are the difficultés if retail prix index for calculating thé value of money
Oscar
hmm OK wait
Castino
what is labour
Mamudou Reply
LABOUR is a measure of work done by human being
Blessing
It is all form of human effort use to utilize in production
Alhaji
Why is scarcity a foundermental problem in economics
Alhaji
Why is scarcity a foundermental problem in economics
Alhaji Reply
scarcity occur unbalance demand and supply at this time cost goods increase then inflation very increase
Tesfaye
scarcity is a foundermental problem because its a natural situation and it affects the world at Large.in other words,it's limit in supply relating to deman
Akwosih
'Economics is about making choices in the presence of scarcity"
manoj Reply
. 'Economics is about making choices in the presence of scarcity" - Dscuss.
manoj
describe the producer's scarce resources.. I.e land,Labour,capital and enterprise
Alfhah Reply
short in supply
Charles
What are human behaviour?
Regina Reply
the rationality in decision making
Charles
how can you describe economic goods in a much better easier way?
Alfhah Reply
any thing that have utility
Charles
what is deman and supply
Aruna Reply
Demand can be defined as the ability and willingness to buy commodities in a given price of goods and services in a particular period of time
Alasana
supply refers to the ability and willingness to offered commodities for sale in a given price of goods and services in a period of time .
Alasana
Demand can refer to the ability and willingness to purchase a commodity at a giving price and time.
habib
what must the producer do if total costs exceed total revenue
Mmusi Reply
raise price
Nguyen
reduce cost
Charles
scarcity resources sample
nawala Reply
land
Charles
what's scarcity
tumelo Reply
resources short in supply
Charles
hello
Shadesch
scarcity is excess against human wants.
Kennedy
scarcity is limit in supply relating to demand
Akwosih
students
Hamdu
shortge of resources .imbalance of wants to resources .
Hamdu
hlo
Yahya
limitation of supply in relation to their demand for commodity
Prince
what are the two types of economic theory's?
Lizabeth Reply
i thick it is microeconomic theory and macroeconomic theory. or it can be normative and positive economic theories.
Deep
yes^
Nguyen
with diagrams show thé change in prices in thé different time period that can result in an increase in demande
Fankam Reply
define momentary period
Fankam
What is a monopsony?
Allan Reply
monopsony is a situation where only one buyer is available in the market
The
And with many sellers?
Allan
oligopsony
The
to be more specific, oligopsony is a situation with many sellers but few buyers
The
Thank you
Allan
Researchers demonstrated that the hippocampus functions in memory processing by creating lesions in the hippocampi of rats, which resulted in ________.
Mapo Reply
The formulation of new memories is sometimes called ________, and the process of bringing up old memories is called ________.
Mapo Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!





Source:  OpenStax, Object-oriented programming (oop) with actionscript. OpenStax CNX. Jun 04, 2010 Download for free at http://cnx.org/content/col11202/1.19
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Object-oriented programming (oop) with actionscript' conversation and receive update notifications?

Ask