<< Chapter < Page Chapter >> Page >

Here is what I believe happens when the html file is opened in a browser that has the Flash Player plug-in installed.

This may be entirely wrong from a detailed technical viewpoint, but I will present it for your considerationbecause it seems to describe what actually happens.

The swf file is opened in the Flash Player

The code inside the html file causes the swf file to be opened in the Flash Player plug-in that has been installed in that browser.

The swf file contains the compiled class definition for the class defined in the source code file mentioned earlier plus a number of other things, including the name of that class. (You can probably think of a swf file as being similar to a zip file or a Java JAR file; a file thatencapsulates other files.)

An object of the class is instantiated

The Flash Player plug-in extracts the name of the class and calls the constructor for that class to instantiate an object of that class.

The constructor is executed

All of the code contained in the constructor plus all of the code called by code in the constructor, plus all of the code called by that code, etc., isexecuted.

Objects of type DisplayObject are displayed

If any of that code instantiates objects that derive from the DisplayObject class and adds those objects to the display list , those objects will be displayed during the next frame.

The current contents of the display list are displayed during each frame

If all of that code terminates without doing something to cause the contents of the display list to be modified or to cause the attributes of those displayobjects to be modified in the future, they will continue to be displayed once during each frame. In that case, the display will appear to be static insofar asthe user is concerned.

Note that some objects, such as Button objects, inherently know how to modify their own attributes under certain circumstances, such as beingrolled over or clicked by the mouse.

Additional code may be executed in the future

The code that is executed and caused to be executed by the constructor may do something to ensure the future execution of additional code, (such as registering TIMER or ENTER_FRAME event listeners).

Code that is executed in the future may modify the display list, may modify the attributes of existing objects on the display list, may instantiate newdisplay objects and add them to the display list, etc. Such changes will be reflected in the visual screen display when they occur.

Frame-to-frame changes in the display

As a result of code that is executed in the future, the display list may change on a frame-to-frame basis causing the physical display to also change ona frame-to-frame basis. In that case, the display won't appear to be static insofar as the user is concerned.

That will be the case for the animation projects that I explain in this lesson.

Time base considerations

In many cases when writing animation code, it is appropriate to use a stable time base to control progress through the program. There are at least twodifferent ways to access a time base when writing ActionScript code:

Questions & Answers

what is phylogeny
Odigie Reply
evolutionary history and relationship of an organism or group of organisms
AI-Robot
ok
Deng
what is biology
Hajah Reply
the study of living organisms and their interactions with one another and their environments
AI-Robot
what is biology
Victoria Reply
HOW CAN MAN ORGAN FUNCTION
Alfred Reply
the diagram of the digestive system
Assiatu Reply
allimentary cannel
Ogenrwot
How does twins formed
William Reply
They formed in two ways first when one sperm and one egg are splited by mitosis or two sperm and two eggs join together
Oluwatobi
what is genetics
Josephine Reply
Genetics is the study of heredity
Misack
how does twins formed?
Misack
What is manual
Hassan Reply
discuss biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles
Joseph Reply
what is biology
Yousuf Reply
the study of living organisms and their interactions with one another and their environment.
Wine
discuss the biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles in an essay form
Joseph Reply
what is the blood cells
Shaker Reply
list any five characteristics of the blood cells
Shaker
lack electricity and its more savely than electronic microscope because its naturally by using of light
Abdullahi Reply
advantage of electronic microscope is easily and clearly while disadvantage is dangerous because its electronic. advantage of light microscope is savely and naturally by sun while disadvantage is not easily,means its not sharp and not clear
Abdullahi
cell theory state that every organisms composed of one or more cell,cell is the basic unit of life
Abdullahi
is like gone fail us
DENG
cells is the basic structure and functions of all living things
Ramadan
What is classification
ISCONT Reply
is organisms that are similar into groups called tara
Yamosa
in what situation (s) would be the use of a scanning electron microscope be ideal and why?
Kenna Reply
A scanning electron microscope (SEM) is ideal for situations requiring high-resolution imaging of surfaces. It is commonly used in materials science, biology, and geology to examine the topography and composition of samples at a nanoscale level. SEM is particularly useful for studying fine details,
Hilary
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




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