<< Chapter < Page Chapter >> Page >

Listing 4 begins by adding a Rect object whose dimensions cover one-hundred percent of the Flash window. (Note that all of the elements in Listing 4 are in the spark namespace named "s".)

What is a fill element?

Unfortunately, this is the point where you need become heavily involved in the concepts of object-oriented programming in ActionScript for the code in Listing 4 to makesense. I apologize in advance for the explanation that follows. However, I don't know any other way to explain it, so I will explain it using a combination ActionScript OOPterminology and mxml terminology.

What is a Rect element?

Rect is a class that represents a rectangle in the ActionScript packagenamed spark.primitives . The mxml code in Listing 4 causes an object of the Rect class to be placed in the Flash window in front of the white default background. As mentioned above, the dimensions of therectangle are such as to cover the entire Flash window, even when the size of the window is changed by the user. (Note that the name Rect begins with an upper-case character. That is a clue as to what is going on.)

Once again, what is a fill element?

Note that the name of this element begins with a lower-case character. That is also a clue as to what is going on. The fill element refers to a property of the Rect object. According to the documentation , the value of this property must be of type IFill .

What is type IFill ?

IFill is the name of an ActionScript interface . (Note that IFill begins with an upper-case character. Once again, that is a clue.) Declaring that the value of the property named fill must be of type IFill means that the value must be a reference to an object of any class that satisfies the interface requirements defined by IFill .

According to the documentation , the following classes satisfy that requirement:

Add a LinearGradient object

The next thing that appears in Listing 4 is an element named LinearGradient . (Note that LinearGradient begins with an upper-case character.) According to the documentation , LinearGradient is a class in the ActionScript package named mx.graphics . (It isn't clear how it can be accessed via the spark namespace, but as you can see in Listing 4, that is obviously thecase.)

What have we accomplished so far?

Up to this point, the interpretation of the code in Listing 4 is that we have:

  1. Created a Rect object, set its width and height attributes to completely cover the Flash window, and added it to the FlashWindow.
  2. Created a LinearGradient object, set its rotation attribute to 90, and assigned its reference to the fill property of the Rect object.

The element named entries

The next thing that we see in Listing 4 is an element named entries that is added to the LinearGradient element. Once again, note that this name begins with a lower-case character.

The documentation tells us that the LinearGradient class has a property named entries . The documentation further tells us that the value of this property must be an array containing references to objects of the class named GradientEntry . These objects "define the fill pattern for the gradient fill."

Questions & Answers

How we are making nano material?
LITNING Reply
what is a peer
LITNING Reply
What is meant by 'nano scale'?
LITNING Reply
What is STMs full form?
LITNING
scanning tunneling microscope
Sahil
what is Nano technology ?
Bob Reply
write examples of Nano molecule?
Bob
The nanotechnology is as new science, to scale nanometric
brayan
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Damian
Is there any normative that regulates the use of silver nanoparticles?
Damian Reply
what king of growth are you checking .?
Renato
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
Stoney Reply
why we need to study biomolecules, molecular biology in nanotechnology?
Adin Reply
?
Kyle
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
Adin
why?
Adin
what school?
Kyle
biomolecules are e building blocks of every organics and inorganic materials.
Joe
anyone know any internet site where one can find nanotechnology papers?
Damian Reply
research.net
kanaga
sciencedirect big data base
Ernesto
Introduction about quantum dots in nanotechnology
Praveena Reply
what does nano mean?
Anassong Reply
nano basically means 10^(-9). nanometer is a unit to measure length.
Bharti
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
Damian Reply
absolutely yes
Daniel
how to know photocatalytic properties of tio2 nanoparticles...what to do now
Akash Reply
it is a goid question and i want to know the answer as well
Maciej
characteristics of micro business
Abigail
for teaching engĺish at school how nano technology help us
Anassong
How can I make nanorobot?
Lily
Do somebody tell me a best nano engineering book for beginners?
s. Reply
there is no specific books for beginners but there is book called principle of nanotechnology
NANO
how can I make nanorobot?
Lily
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
s.
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
Tarell
what is the actual application of fullerenes nowadays?
Damian
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
Tarell
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
Mostly, they use nano carbon for electronics and for materials to be strengthened.
Virgil
is Bucky paper clear?
CYNTHIA
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
NANO
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, Introduction to xml. OpenStax CNX. Dec 02, 2014 Download for free at https://legacy.cnx.org/content/col11207/1.18
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Introduction to xml' conversation and receive update notifications?

Ask
Eric Crawford
Start Quiz