do
not
have
the
same
direct
parent
(e.g.
The
FlashEff2Code
instance

was
added
to
the
display
list
as
a
child
of
clip1
and
the
target
object

is
myClip.container.targetClip).
This
property
must
be
set
after
both

the
target
object
and
the
FlashEff2Code
component
were
added
to

the
display
list.


Example

The
next
example
appli
es
a
show
transition
based
on
the
Alpha

pattern
(FESAlpha),
to
a
clip
(symbol)
called
myClip.


Create
a
movie
clip
on
the
stage
and
give
it
an
instance
name
of

myClip.
Next,
from
the
Components
panel
drag
the
FlashEff2Code

component
and
the
FESAlpha
patter
n
into
the
Library.
Bring
up
the

Actions
panel
and
paste
the
following
code
into
it:


var myEffect:FlashEff2Code = new
FlashEff2Code();

myEffect.showTransitionName =
"com.jumpeye.flashEff2.symbol.alpha.FESAlpha";

this.addChild(myEffect);

myEffect._targetIn
stanceName = "myClip";

trace(myEffect.target+" ::
"+myEffect.target.name); // [object MovieClip]
:: myClip

targetVisibility

Boolean

Yes

Specifies
whether
the
target
object
is
visible
at
the
beginning,
before

applying
the
show
or
hide
transitions.
If
true
,
the
target
object
will
be

displayed
during
the
time
interval
specified
at

showDelay

or

hideDelay

and,
after
that,
the
show
or
hide
transition
will
start.
In

case
of
a
show
transition,
the
target
will
be
displayed
for
the
amount

of
time
specified
by

showD
elay

and
then
hidden,
before
the

transition
starts.
This
property
can
also
be
set
from
the
FlashEff2

panel
by
selecting
the
"target
is
visible"
option
in
the
Show
or
Hide

tab.


The
default
value
is

true
.


Example

The
next
example
applies
a
show
transition

based
on
the
Alpha

pattern
(FESAlpha),
to
a
clip
(symbol)
called
myClip.
Before
the

executing
the
transition,
there
is
a
3
second
delay
while
the
target

object
is
kept
invisible
because

targetVisibility

is
set
to
false.


Create
a
movie
clip
on
the
stage
an
d
give
it
an
instance
name
of

myClip.
Next,
from
the
Components
panel
drag
the
FlashEff2Code

component
and
the
FESAlpha
pattern
into
the
Library.
Bring
up
the

Actions
panel
and
paste
the
following
code
into
it:


31


import
com.jumpeye.flashEff2.symbol.alpha.FE
SAlpha;


var myPattern:FESAlpha = new FESAlpha();


var myEffect:FlashEff2Code = new
FlashEff2Code();

myEffect.showTransition = myPattern;

myEffect.showDelay = 3;

myEffect.targetVisibility = false;

this.addChild(myEffect);

myEffect._targetInstanceName = "my
Clip";


textField

TextField

No

The
reference
to
the
target
text
field
on
which
the
effect
is
applied.

You
can
directly
access
the
properties
and
methods
of
the
target
text

field
by
accessing
this
property
of
the
FlashEff2Code
component

instance.


Example

The
next
example
applies
a
show
transition
based
on
the
Alpha

pattern
(FETAlpha),
on
a
text
field
called
myTextField.



Place
a
dynamic
text
field
on
the
stage,
enter
the
"The
quick
brown

fox
jumps
over
the
lazy
dog"
text
into
it
and
give
it
an
instance
na
me

of
myTextField.
Change
the
anti

alias
setting
to
"Anti

alias
for

animation",
enable
the
"Render
text
as
HTML"
option
and
embed
the

characters
using
the
Auto
Fill
option
in
the
Embed
characters
dialog

box.
Next,
from
the
Components
panel
drag
the
FlashEf
f2Code

component
and
the
FETAlpha
pattern
into
the
Library.
Bring
up
the

Actions
panel
and
paste
the
following
code
into
it:


var myEffect:FlashEff2Code = new
FlashEff2Code();

myEffect.showTransitionName =
"com.jumpeye.flashEff2.text.alpha.FETAlpha";

this.
addChild(myEffect);

myEffect._targetInstanceName = "myTextField";

trace(myEffect.target+" ::
"+myEffect.target.name);


toggle

Boolean

No

This
property
indicates
whether
the
target
display
object
used
as
a

button
(a
button
effect
is
applied
on
it)
can
be
t
oggled
or
not.

If
it
is

set
to

false
,
the
button
will
not
have
a
selected
state.


The
default
value
is

true
.


useHandCursor

Boolean

Yes

A
Boolean
value
that
indicates
whether
the
pointing
hand
(hand

cursor)
appears
when
the
mouse
rolls
over
the
target
obj
ect.
If
this

property
is
set
to

true

the

buttonMode

property
is
set
to

true

automatically
and
the
pointing
hand
used
for
buttons
appears
when

the
mouse
rolls
over
the
target
object.
If

useHandCursor

is

false
,
the
arrow
pointer
is
used
instead.
You
can
chan
ge
the

useHandCursor

property
any
time,
either
by
code
or
from
the

FlashEff2
panel
itself.




32

The
default
value
is

false
.


useSwapInsteadHide

Boolean

Yes

A
Boolean
value
which
indicates
whether
a
swap
transition
should
be

made
instead
of
a
hide
transition.

If


true
,
a
swap
transition
will

take
place
and
not
the
hide
transition.
This
property
must
always
be

set
to
true,
if
you
wan
to
swap
the
current
target
object
with
another

one.
The
swap
transition
will
apply
a
hide
transition
on
the
current

text
field
if

swapType
is

FlashEff2.SWAP_TYPE_HIDE

or

FlashEff2.SWAP_TYPE_HIDE_AND_SHOW

and
perform
a
show

transition
on
the
second
text
field
if

swapType

is

FlashEff2.SWAP_TYPE_SHOW

or

FlashEff2.SWAP_TYPE_HIDE_AND_SHOW
.


The
default
value
is

false
.


Example

The
next
e
xample
applies
a
show
transition
based
on
the
Alpha

pattern
(FETAlpha)
to
a
text
field
called
myTextField1
and
then
swaps

the
text
field
with
another
one
called
myTextField2.
The
swap

operation
hides
the
first
text
field
using
the
Blur
pattern
(FETBlur)

an
d
then
displays
the
second
text
field
at
the
same
time
with
the

Alpha
pattern.


Place
two
dynamic
text
fields
on
the
stage,
enter
the
"This
is
the
first

text
field"
text
into
one
of
them
and
"This
is
the
second
text
field"

text
into
he
other
and
give
them

instance
names
of
myTextField1
for

the
first
text
field
and
myTextField2
for
the
second
one.
Change
the

anti

alias
setting
to
"Anti

alias
for
animation",
enable
the
"Render

text
as
HTML"
option
and
embed
the
characters
using
the
Auto
Fill

option
in
the
Emb
ed
characters
dialog
box
for
both
text
fields.
Next,

from
the
Components
panel
drag
the
FlashEff2Code
component
and

the
FETAlpha
and
FETBlur
patterns
into
the
Library.
Bring
up
the

Actions
panel
and
paste
the
following
code
into
it:


import
com.jumpeye.fla
shEff2.text.alpha.FETAlpha;

import com.jumpeye.flashEff2.text.blur.FETBlur;


var showPattern1:FETAlpha = new FETAlpha();

var showPattern2:FETAlpha = new FETAlpha();

var hidePattern:FETBlur = new FETBlur();

var myEffect:FlashEff2Code = new
FlashEff2Code();


myEffect.targetVisibility = false;

myEffect.showTransition = showPattern1;

myEffect.hideTransition = hidePattern;

myEffect.useSwapInsteadHide = true;

myEffect.swapType =
FlashEff2.SWAP_TYPE_HIDE_AND_SHOW;

myEffect.swapTransition = showPattern2;

myEffect.s
wapDelay = 0;

myEffect.swapTargetVisibility = false;


this.addChild(myEffect);

myEffect.swapTargetInstanceName =
"myTextField2";


33

myEffect._targetInstanceName = "myTextField1";


xmlPath

String

Yes

The
path
and
name
of
the
.xml
file
used
to
set
up
the
curre
nt

FlashEff2Code
instance.
If
such
a
file
is
defined
and
set
to
the

component
instance,
then
when
the
component
initializes,
the

settings
from
the
.xml
file
will
override
any
other
settings
done

through
the
FlashEff2
panel
or
through
ActionScript
code
(if

those

were
made
before
setting
the
xmlPath
property).


Example


var myEffect:FlashEff2Code = new
FlashEff2Code();

this.addChild(myEffect);

myEffect.xmlPath =
"files/config/xml/setup.xml";





Methods

Method

Description

addCommand

Adds
a
new
command
patte
rn
to
the
target
object.
The
new
command
will
be

executed
on
the
event
specified
as
argument.



Parameters


command:IFlashEffCommand



The
reference
to
the
command
pattern

created
by
code.

eventType:String



The
event
on
which
the
selected
command
will
be

executed.
Possible
values
are

rollOver
,

rollOut
,

press

and

release
.


Returns


IFlashEffCommand



A
reference
to
the
newly
created
command
pattern.


Example

This
example
lists
all
the
commands
applied
to
the
target
object,
in
this
case,
a

single
navigateToU
RL
command
(FECNavigateToURL).



Create
a
movie
clip
on
the
stage
and
give
it
an
instance
name
of
myClip.
Next,

from
the
Components
panel
drag
the
FlashEff2Code
component
and
the

FECNavigateToURL
pattern
into
the
Library.
Bring
up
the
Actions
panel
and
pas
te

the
following
code
into
it:


import
com.jumpeye.flashEff2.command.navigateToURL.FECNavigat
eToURL;


var myPattern:FECNavigateToURL = new
FECNavigateToURL();

myPattern.url = "http://www.flasheff.com/";


34

var myEffect:FlashEff2Code = new FlashEff2Code();

myE
ffect.addCommand(myPattern, "release");

this.addChild(myEffect);

myEffect._targetInstanceName = "myClip";

for(var i:int = 0; i < myEffect.commands.length; i++)
trace(i+" :: "+myEffect.commands[i]); // 0 :: [object
FECNavigateToURL]



addCommandByName

Add
s
a
new
command
pattern
to
the
target
object.
The
new
command
will
be

executed
on
the
event
specified
as
argument.



Parameters

commandName:String



The
full
path
of
the
command
pattern
class
added

to
the
target
object.

eventType:String



The
event
on
whic
h
the
selected
command
will
be

executed.
Possible
values
are

rollOver
,

rollOut
,

press

and

release
.

initObj:Object

(default
=

null
)



An
object
used
to
initialize
the

command
pattern.


Returns

IFlashEffCommand



A
reference
to
the
newly
created
command
patt
ern.


Example

This
example
lists
all
the
commands
applied
to
the
target
object,
in
this
case,
a

single
navigateToURL
command
(FECNavigateToURL).



Create
a
movie
clip
on
the
stage
and
give
it
an
instance
name
of
myClip.
Next,

from
the
Components
panel
drag

the
FlashEff2Code
component
and
the

FECNavigateToURL
pattern
into
the
Library.
Bring
up
the
Actions
panel
and
paste

the
following
code
into
it:


var myEffect:FlashEff2Code = new FlashEff2Code();

var initObj:Object = new Object();

initObj.url = "http://www
.flasheff.com/";


myEffect.addCommandByName("com.jumpeye.flashEff2.comma
nd.navigateToURL.FECNavigateToURL", "release",
initObj);

this.addChild(myEffect);

myEffect._targetInstanceName = "myClip";

for(var i:int = 0; i < myEffect.commands.length; i++)
trace(i
+" :: "+myEffect.commands[i]); // 0 :: [object
FECNavigateToURL]


addFilter

Adds
a
new
filter
pattern
to
target
symbol
or
text
field.


Parameters

filter:IFlashEffFilter



The
reference
to
the
filter
pattern,
created

separately
by
code.


Example

This
exam
ple
lists
all
the
filters
applied
to
the
target
object,
in
this
case,
a
single

reflection
filter
(FEFReflection).



Create
a
movie
clip
on
the
stage
and
give
it
an
instance
name
of
myClip.
Next,

from
the
Components
panel
drag
the
FlashEff2Code
component
an
d
the


35

FEFReflection
pattern
into
the
Library.
Bring
up
the
Actions
panel
and
paste
the

following
code
into
it:


import
com.jumpeye.flashEff2.filter.reflection.FEFReflection;


var myPattern:FEFReflection = new FEFReflection();

var myEffect:FlashEff2Code = n
ew FlashEff2Code();

myEffect.addFilter(myPattern);

this.addChild(myEffect);

myEffect._targetInstanceName = "myClip";

for(var i:int = 0; i < myEffect.filterList.length;
i++) trace(i+" :: "+myEffect.filterList[i]); // 0 ::
[object FEFReflection]


addFilter
ByName

Adds
a
new
Filter
pattern
to
target
symbol
or
text.


Parameters

filterName:String



The
full
package
and
class
name
of
the
filter
that
will

be
applied.

initObject:Object

(default
=

null
)



[optional]
An
object
used
to
set
up

the
new
filter.


Returns

IFlashEffFilter



A
reference
to
the
newly
created
filter
pattern.


Example

This
example
lists
all
the
filters
applied
to
the
target
object,
in
this
case,
a
single

reflection
filter
(FEFReflection).



Create
a
movie
clip
on
the
stage
and
give
it
an
instan
ce
name
of
myClip.
Next,

from
the
Components
panel
drag
the
FlashEff2Code
component
and
the

FEFReflection
pattern
into
the
Library.
Bring
up
the
Actions
panel
and
paste
the

following
code
into
it:


var myEffect:FlashEff2Code = new FlashEff2Code();

var init
Obj:Object = new Object();

initObj.reflectionDistance = 0;


myEffect.addFilterByName("com.jumpeye.flashEff2.filter
.reflection.FEFReflection", initObj);

this.addChild(myEffect);

myEffect._targetInstanceName = "myClip";

for(var i:int = 0; i < myEffect.filter
List.length;
i++) trace(i+" :: "+myEffect.filterList[i]); // 0 ::
[object FEFReflection]


applyButtonEffect

Reapplies
the
ButtonEffect
pattern
to
the
target
object,
after
it
has
been

removed
with
the

removeButtonEffect()

method.


buttonPress

Manually
ap
plies
the
mouse
press
state
to
the
target
object,
without
the
mouse

press
action,
and
dispatches
the

FLASHEFFEvents.MOUSE_DOWN

event.
This

is
useful
when
the
component
should
visually
change
the
state
of
the
target

object
but
not
as
a
result
of
mouse
inter
action.


buttonRelease

Manually
applies
the
mouse
release
state
to
the
target
object,
without
the

mouse
release
action,
and
dispatches
the

FLASHEFFEvents.MOUSE_UP


36

event.
This
is
useful
when
the
component
should
visually
change
the
state
of
the

target
obje
ct
but
not
as
a
result
of
mouse
interaction.


buttonRollOut

Manually
applies
the
roll
out
state
to
the
target
object,
without
the
mouse

moving
out
of
it,
and
dispatches
the

FLASHEFFEvents.ROLL_OUT

event.

This
is
useful
when
the
component
should
visually
c
hange
the
state
of
the
target

object
but
not
as
a
result
of
mouse
interaction.


buttonRollOver

Manually
applies
the
roll
over
state
to
the
target
object,
without
the
mouse

getting
over
it,
and
dispatches
the

FLASHEFFEvents.ROLL_OVER

event.

This
is
useful

when
the
component
should
visually
change
the
state
of
the
target

object
but
not
as
a
result
of
mouse
interaction.


changeTarget

Changes
the
target
of
the
FlashEff2Code
instance
by
applying
a
hide
first
on
the

last
visible
target,
then
it
shows
the
newTar
get
object
with
the
selected
show

pattern.

The
method
does
suppress
autoPlay
and
will
count
the
delays.


Parameters

newTarget:DisplayObject


The
object
to
be
used
instead
the
current

target.


Example

myEffect.changeTarget(myNewTarget);


dispatchEvent

Disp
atches
a

FLASHEFFEvent

type
of
event.


Parameters

ev:Event



The
event
object
dispatched
as
parameter.
This
object
has
a
type

which
usually
is
one
of
the
types
described
in
the

FLASHEFFEvent

class
and

additional
information
about
the
event
that
is
being
di
spatched.



Returns

Boolean



A
value
of

true

if
the
event
was
successfully
dispatched.
A
value

of

false

indicates
failure
or
that

preventDefault()

was
called
on
the

event.


getFilter

Returns
a
reference
to
the
filter
pattern
specified
in
the
argument.


P
arameters

filterName:String



The
full
package
and
class
name
of
the
filter
pattern

that
should
be
returned.


Returns

IFlashEffFilter



A
reference
to
the
desired
filter
pattern
or
the
value

null

if
it
was
not
found
among
the
filter
patterns
applied
to
the

target
object.


Example

This
example
adds
a
filter
to
a
clip
(symbol)
called
myClip
and
lists
the
filter
by

using
the
appropriate
methods.


Create
a
movie
clip
on
the
stage
and
give
it
an
instance
name
of
myClip.
Next,

from
the
Components
panel
drag
the
F
lashEff2Code
component
and
the

FEFReflection
pattern
into
the
Library.
Bring
up
the
Actions
panel
and
paste
the


37

following
code
into
it:


var myEffect:FlashEff2Code = new FlashEff2Code();

var initObj:Object = new Object();

initObj.reflectionDistance = 0;


m
yEffect.addFilterByName("com.jumpeye.flashEff2.filter
.reflection.FEFReflection", initObj);

this.addChild(myEffect);

myEffect._targetInstanceName = "myClip";


trace(myEffect.getFilter("com.jumpeye.flashEff2.filter
.reflection.FEFReflection")); // [object
FE
FReflection]

trace(myEffect.getFilterAt(0)); // [object
FEFReflection]


getFilterAt

Returns
the
filter
pattern
that
exists
at
the
specified
index.


Parameters

index:uint



The
index
which
the
target
filter
pattern
has
in
the
list
of
filters

applied
to
th
e
target
symbol
or
text.


Returns

IFlashEffFilter



The
filter
pattern
that
is
located
at
the
specified
index.


Example

This
example
adds
a
filter
to
a
clip
(symbol)
called
myClip
and
lists
the
filter
by

using
the
appropriate
methods.


Create
a
movie
clip

on
the
stage
and
give
it
an
instance
name
of
myClip.
Next,

from
the
Components
panel
drag
the
FlashEff2Code
component
and
the

FEFReflection
pattern
into
the
Library.
Bring
up
the
Actions
panel
and
paste
the

following
code
into
it:


var myEffect:FlashEff2Co
de = new FlashEff2Code();

var initObj:Object = new Object();

initObj.reflectionDistance = 0;


myEffect.addFilterByName("com.jumpeye.flashEff2.filter
.reflection.FEFReflection", initObj);

this.addChild(myEffect);

myEffect._targetInstanceName = "myClip";


tra
ce(myEffect.getFilter("com.jumpeye.flashEff2.filter
.reflection.FEFReflection")); // [object
FEFReflection]

trace(myEffect.getFilterAt(0)); // [object
FEFReflection]


getNumGroupButtons

Returns
the
number
of
group
buttons
(target
display
objects
with
but
ton
effects)

that
have
the
group
name
of
the
current
FlashEff2Code
instance.


Returns

uint



The
number
of
group
buttons
in
the
current
button
group.


Example


38

The
next
example
will
create
a
group
of
radio
buttons
using
FlashEff2.


Create
a
movie
clip
on
th
e
stage
that
will
be
used
as
button
and
duplicate
it.
Give

each
one
an
instance
name:
"button1"
and
"button2".

Next,
from
the

Components
panel
drag
the
FlashEff2Code
component
and
the
FEBEffect
pattern

into
the
Library.
Bring
up
the
Actions
panel
and
paste

the
following
code
into
it:


import com.jumpeye.flashEff2.buttonEffect.FEBEffect;


var overState:XML = <value>

<tweenDuration>

<type>Number</type>

<value>1</value>

<defaultValue>1</defaultValue>


</tweenDuration>

<tweenType>

<type>String</type>

<value>Strong</value>

<defaultValue>Strong</defaultValue>

</tweenType>

<easeType>

<type>String</type>


<value>easeOut</value>

<defaultValue>easeOut</defaultValue>

</easeType>

<blurFilter>

<type>Object</type>

<value/>

</blurFilter>

<glowFilter>

<typ
e>Object</type>

<value>

<color hasCheck="false">

<type>uint</type>

<value>26367</value>

<defaultValue>14492194</defaultValue>

</color>

<alph
a hasCheck="false">

<type>Number</type>

<value>1</value>

<defaultValue>1</defaultValue>

</alpha>

<blurX hasCheck="false">

<type>Number</type>


<value>12</value>

<defaultValue>10</defaultValue>

</blurX>

<blurY hasCheck="false">

<type>Number</type>

<value>12</value>

<defaultValue>10</defa
ultValue>

</blurY>

<strength hasCheck="false">

<type>Number</type>

<value>2</value>

<defaultValue>2</defaultValue>

</strength>

<quality ha
sCheck="false">

<type>Number</type>

<value>2</value>

<defaultValue>2</defaultValue>

</quality>

<inner hasCheck="false">

<type>Boolean</type>


<value>false</value>

<defaultValue>false</defaultValue>

</inner>

<knockout hasCheck="false">

<type>Boolean</type>

<value>false</value>

<defaultVa
lue>false</defaultValue>

</knockout>

</value>


39

</glowFilter>

</value>;


var selectedUpState:XML = <value>

<blurFilter>

<type>Object</type>

<value/>

</blu
rFilter>

<glowFilter>

<type>Object</type>

<value>

<color hasCheck="false">

<type>uint</type>

<value>52224</value>

</color>

<alpha ha
sCheck="false">

<type>Number</type>

<value>1</value>

</alpha>

<blurX hasCheck="false">

<type>Number</type>

<value>12</value>

</blurX>


<blurY hasCheck="false">

<type>Number</type>

<value>12</value>

</blurY>

<quality hasCheck="false">

<type>Number</type>

<value>2</value>


</quality>

<inner hasCheck="false">

<type>Boolean</type>

<value>false</value>

</inner>

<knockout hasCheck="false">

<type>Boolean</type>


<value>false</value>

</knockout>

<strength hasCheck="false">

<type>Number</type>

<value>2</value>

</strength>

</value>

</glowFilter>

<tweenDuration>

<type>Number</type>

<value>0.3</value>

<defaultValue>0.3</defaultValue>

</tweenDuration>

<tweenType>

<type>String</type>

<value>Quadr
atic</value>

<defaultValue>Quadratic</defaultValue>

</tweenType>

<easeType>

<type>String</type>

<value>easeOut</value>

<defaultValue>easeOut</defaultValue>

</easeTy
pe>

</value>;


// Create the button effect for the first

//
movie clip (button1).

var btn1:FEBEffect = new FEBEffect();

btn1.overState = overState;

btn1.selectedUpState = selectedUpState;


// Create t
he button effect for the second

//
movie clip
(button2).

var btn2:FEBEffect = new FEBEffect();

btn2.overState = overState;

btn2.selectedUpState = selectedUpState;


40


// Create the first FlashEff2 instance and

//
add it to the

display list.

var effect1:FlashEff2Code = new FlashEff2Code();

effect1.useHa
ndCursor = true;

effect1.groupName = "myGroup";

effect1.buttonEffect = btn1;

addChild(effect1);


// Create the second FlashEff2 instance and

//
add it to the

display list.

var effect2:FlashEff2Code = new FlashEff2Code();

effect2.useHandCursor = true;

effe
ct2.groupName = "myGroup";

effect2.buttonEffect = btn2;

addChild(effect2);


// Apply the two FlashEff2 instances to the

// two movie clips.

effect1._targetInstanceName = "button1";

effect2._targetInstanceName = "button2";


trace("Number of
grouped
buttons:

"+effect1.getNumGroupButtons());
// Number of group
ed
buttons: 2


hide

Hides
the
target
object
using
the
pattern
currently
applied
to
the
target
object

(symbol
or
text
field).
If
the
FlashEff2Code
instance
does
not
have
a
symbol
or

text
pattern
applied,

it
will
not
execute
anything.


Example

The
next
example
applies
a
hide
transition
based
on
the
Alpha
pattern

(FESAlpha),
to
a
clip
(symbol)
called
myClip.
The
hide
transition
will
not
execute

automatically
since
the
hide
AutoPlay

property
is
set
to

false
,
b
ut
it
will

execute
on
mouse
click
over
the
target
clip.


Create
a
movie
clip
on
the
stage,
give
it
an
instance
name
of
myClip
and
also

place
a
button
on
the
stage
and
name
it
buttonInstance.
Next,
from
the

Components
panel
drag
the
FlashEff2Code
component

and
the
FESAlpha
pattern

into
the
Library.
Bring
up
the
Actions
panel
and
paste
the
following
code
into
it:


import com.jumpeye.flashEff2.symbol.alpha.FESAlpha;


var myPattern:FESAlpha = new FESAlpha();

var myEffect:FlashEff2Code = new FlashEff2Code();

myE
ffect.hideTransition = myPattern;

myEffect.hideDelay = 0;

myEffect.hideAutoPlay = false;

this.addChild(myEffect);

myEffect._targetInstanceName = "myClip";


buttonInstance.addEventListener(MouseEvent.CLICK,
clikHandler);


function clikHandler(evt:MouseEvent
):void {


myEffect.hide();

}



41

removeAll

Removes
all
the
show/hide
effects,
filters,
commands
and
button
effects
added

through
the
FlashEff2Code
component
instance,
to
the
target
object
(symbol
or

text
field),
canceling
any
functionality
provided
by
them.

This
method
will
not

remove
the
FlashEff2Code
instance.
To
remove
the
FlashEff2Code
instance
too,

you'll
need
to
remove
it
from
the
display
list.


removeAllCommands

Removes
all
the
command
patterns
applied
to
the
target
object.


Example

This
example
adds

the
navigateToURL
command
to
a
clip,
on
both,
the
mouse

press
and
mouse
release
actions
and
displays
the
list
of
commands.
When
a

button
is
pressed,
the
commands
are
removed.


Create
a
movie
clip
on
the
stage,
give
it
an
instance
name
of
myClip
and
also

pl
ace
a
button
on
the
stage
and
name
it
buttonInstance.
Next,
from
the

Components
panel
drag
the
FlashEff2Code
component
and
the

FECNavigateToURL
pattern
into
the
Library.
Bring
up
the
Actions
panel
and
paste

the
following
code
into
it:


import
com.jumpeye.f
lashEff2.command.navigateToURL.FECNavigat
eToURL;


var myPattern1:FECNavigateToURL = new
FECNavigateToURL();

myPattern1.url = "http://www.flasheff.com/";

var myPattern2:FECNavigateToURL = new
FECNavigateToURL();

myPattern2.url = "http://www.jumpeyecomponent
s.com/";

var myEffect:FlashEff2Code = new FlashEff2Code();

myEffect.addCommand(myPattern1, "press");

myEffect.addCommand(myPattern2, "release");

this.addChild(myEffect);

myEffect._targetInstanceName = "myClip";


trace(myEffect.commands.length+" commands ap
plied to
the target object");

for(var i:int = 0; i < myEffect.commands.length; i++)
trace(i+" :: "+myEffect.commands[i]);

/* output:

2 commands applied to the target object

0 :: [object FECNavigateToURL]

1 :: [object FECNavigateToURL]

*/


buttonInstance.a
ddEventListener(MouseEvent.CLICK,
clikHandler);


function clikHandler(evt:MouseEvent):void {


myEffect.removeAllCommands();


trace(myEffect.commands.length+" commands
applied to the target object");


for(var i:int = 0; i < myEffect.commands.length;
i++) tr
ace(i+" :: "+myEffect.commands[i]);


/* output:


0 commands applied to the target object


*/

}



42

removeAllCommandsByEventType

Removes
all
the
command
patterns
from
the
target
object,
that
are
executed
on

a
specified
event.


Parameters

eventType:String



Th
e
type
of
event
for
which
all
the
command
patterns

will
be
removed.
Possible
values
are

rollOver
,

rollOut
,

press

and

release
.


Example

This
example
adds
the
navigateToURL
command
to
a
clip,
on
both
the
mouse

press
and
mouse
release
actions
and
displays
the

list
of
commands.
When
a

button
is
pressed,
the
command
added
for
the
mouse
press
event
is
removed.


Create
a
movie
clip
on
the
stage,
give
it
an
instance
name
of
myClip
and
also

place
a
button
on
the
stage
and
name
it
buttonInstance.
Next,
from
the

Compo
nents
panel
drag
the
FlashEff2Code
component
and
the

FECNavigateToURL
pattern
into
the
Library.
Bring
up
the
Actions
panel
and
paste

the
following
code
into
it:


import
com.jumpeye.flashEff2.command.navigateToURL.FECNavigat
eToURL;


var myPattern1:FECNaviga
teToURL = new
FECNavigateToURL();

myPattern1.url = "http://www.flasheff.com/";

var myPattern2:FECNavigateToURL = new
FECNavigateToURL();

myPattern2.url = "http://www.jumpeyecomponents.com/";

var myEffect:FlashEff2Code = new FlashEff2Code();

myEffect.addCom
mand(myPattern1, "press");

myEffect.addCommand(myPattern2, "release");

this.addChild(myEffect);

myEffect._targetInstanceName = "myClip";


trace(myEffect.commands.length+" commands applied to
the target object");

for(var i:int = 0; i < myEffect.commands.len
gth; i++)
trace(i+" :: "+myEffect.commands[i]);

/* output:

2 commands applied to the target object

0 :: [object FECNavigateToURL]

1 :: [object FECNavigateToURL]

*/


buttonInstance.addEventListener(MouseEvent.CLICK,
clikHandler);


function clikHandler(evt:
MouseEvent):void {


myEffect.removeAllCommandsByEventType("press");


trace(myEffect.commands.length+" commands
applied to the target object");


for(var i:int = 0; i < myEffect.commands.length;
i++) trace(i+" :: "+myEffect.commands[i]);


/* output:


1 comma
nds applied to the target object


0 :: [object FECNavigateToURL]


*/

}


43

removeAllFilters

Removes
all
the
filter
patterns
applied
on
the
current
FlashEff2Code
component

instance,
visually
removing
them
from
the
target
symbol
or
text,
but
leaving
all

the
oth
er
types
of
patterns.


removeButtonEffect

Removes
the
current
ButtonEffect
pattern
applied
to
the
target
object.


removeCommand

Removes
the
specified
command
pattern
instance
from
the
target
object.


Parameters

command:IFlashEffCommand



The
pattern
inst
ance
that
should
be

removed.


Example

This
example
adds
a
navigateToURL
and
a
goToFrame
command
to
a
clip,
on
the

mouse
press
action
and
displays
the
list
of
commands.
When
a
button
is
pressed,

the
goToFrame
command
is
removed.


Create
a
movie
clip
on
the

stage,
give
it
an
instance
name
of
myClip
and
also

place
a
button
on
the
stage
and
name
it
buttonInstance.
Next,
from
the

Components
panel
drag
the
FlashEff2Code
component,
the
FECNavigateToURL

and
the
FECGoToFrame
patterns
into
the
Library.
Bring
up
the
A
ctions
panel
and

paste
the
following
code
into
it:


import
com.jumpeye.flashEff2.command.navigateToURL.FECNavigat
eToURL;

import
com.jumpeye.flashEff2.command.goToFrame.FECGoToFrame;


var myPattern1:FECNavigateToURL = new
FECNavigateToURL();

myPattern1.url
= "http://www.flasheff.com/";

var myPattern2:FECGoToFrame = new FECGoToFrame();

myPattern2.frame = "10";

var myEffect:FlashEff2Code = new FlashEff2Code();

myEffect.addCommand(myPattern1, "release");

myEffect.addCommand(myPattern2, "release");

this.addChild
(myEffect);

myEffect._targetInstanceName = "myClip";


trace(myEffect.commands.length+" commands applied to
the target object");

for(var i:int = 0; i < myEffect.commands.length; i++)
trace(i+" :: "+myEffect.commands[i]);

/* output:

2 commands applied to the
target object

0 :: [object FECNavigateToURL]

1 :: [object FECGoToFrame]

*/


buttonInstance.addEventListener(MouseEvent.CLICK,
clikHandler);


function clikHandler(evt:MouseEvent):void {


myEffect.removeCommand(myPattern2);


trace(myEffect.commands.length+"
commands
applied to the target object");


for(var i:int = 0; i < myEffect.commands.length;

44

i++) trace(i+" :: "+myEffect.commands[i]);


/* output:


1 commands applied to the target object


0 :: [object FECNavigateToURL]


*/

}


removeCommandByName

Removes

from
the
target
object
the
command
pattern
identified
by
its
full
path

and
class
name.


Parameters

commandName:String



The
full
path
and
class
name
of
the
command

pattern
to
be
removed.


Example

This
example
adds
a
navigateToURL
and
a
goToFrame
command
to

a
clip,
on
the

mouse
press
action
and
displays
the
list
of
commands.
When
a
button
is

pressed,
the
goToFrame
command
is
removed.


Create
a
movie
clip
on
the
stage,
give
it
an
instance
name
of
myClip
and
also

place
a
button
on
the
stage
and
name
it
buttonI
nstance.
Next,
from
the

Components
panel
drag
the
FlashEff2Code
component,
the
FECNavigateToURL

and
the
FECGoToFrame
patterns
into
the
Library.
Bring
up
the
Actions
panel
and

paste
the
following
code
into
it:


import
com.jumpeye.flashEff2.command.navigateT
oURL.FECNavigat
eToURL;

import
com.jumpeye.flashEff2.command.goToFrame.FECGoToFrame;


var myPattern1:FECNavigateToURL = new
FECNavigateToURL();

myPattern1.url = "http://www.flasheff.com/";

var myPattern2:FECGoToFrame = new FECGoToFrame();

myPattern2.frame =
"10";

var myEffect:FlashEff2Code = new FlashEff2Code();

myEffect.addCommand(myPattern1, "release");

myEffect.addCommand(myPattern2, "release");

this.addChild(myEffect);

myEffect._targetInstanceName = "myClip";


trace(myEffect.commands.length+" commands ap
plied to
the target object");

for(var i:int = 0; i < myEffect.commands.length; i++)
trace(i+" :: "+myEffect.commands[i]);

/* output:

2 commands applied to the target object

0 :: [object FECNavigateToURL]

1 :: [object FECGoToFrame]

*/


buttonInstance.addEve
ntListener(MouseEvent.CLICK,
clikHandler);


function clikHandler(evt:MouseEvent):void {


myEffect.removeCommandByName("com.jumpeye.flashE
ff2.command.goToFrame.FECGoToFrame");


trace(myEffect.commands.length+" commands

45

applied to the target object");


for(v
ar i:int = 0; i < myEffect.commands.length;
i++) trace(i+" :: "+myEffect.commands[i]);


/* output:


1 commands applied to the target object


0 :: [object FECNavigateToURL]


*/

}


removeEffect

Stops
and
removes
an
effect
applied
to
the
target
object,
while

that
effect
is
still

playing.
This
function
will
not
have
any
effect
if
it's
applied
before
the
effect

starts
or
after
the
effect
has
finished
(except
when

isTargetVisibleAtEnd

is
set
to

true

and
the
transition
type
was

hide
).
Depending
on
the
value
of
th
e

internalCall

argument,
it
can
trigger
a

FLASHEFFEvents.TRANSITION_END

event
or
not.
If
the
method
was

called
from
within
an
internal
class
or
a
pattern
object,
this
parameter
should
be

true

and
the
event
will
not
trigger.
If
the
method
was
called
from
ou
tside
the

FlashEff2
class
or
outside
the
patterns,
then
the
parameter's
value
should
be

false

(the
default
value)
and
the

FLASHEFFEvents.TRANSITION_END

event
will
be
triggered.



This
also
has
the
possibility
to
remove
a
specific
symbol
or
text
pattern
fro
m
the

target
object,
by
specifying
a
second
argument.
If
that
pattern
argument
is
not

specified,
the
method
removes
the
current
symbol
or
text
pattern
that
is
being

applied
(while
the
transition
is
going
on).


In
the
case
of
a
hide
transition,
either
on
a

symbol
or
a
text
object,
the
target

object
will
be
rendered
invisible
in
the
end,
by
the
transition.
If

removeEffect()

is
called
after
the
transition
has
finished,
the
target

object
will
be
displayed
only
if
the

isTargetVisibleAtEnd

is
set
to

true
,
otherwi
se
the
target
object
will
remain
hidden
(the
method
has
no

effect).


Parameters

internalCall:Boolean

(default
=

false
)



[optional]
Instructs
the

method
to
dispatch
a

FLASHEFFEvents.TRANSITION_END

event,
if
the

value
is

false
,
that
is
if
the
method
is
not

called
from
inside
a
pattern
object.

pattern:IFlashEffSymbolText
(default
=

null
)



The
symbol
or
text

pattern
that
should
be
removed
from
the
list
of
patterns
applied
to
the
target

object.
That
type
of
pattern
is
a
show/hide
pattern,
meaning
that
it
can
o
nly

apply
show
or
hide
transitions
on
symbols
or
text
fields.


Example

The
next
example
applies
a
hide
transition
based
on
the
Alpha
pattern

(FETAlpha),
on
a
text
field
called
myTextField.
The
hide
transition
will
be

executed
automatically,
with
a
delay
of

a
second.
By
pressing
the
button
on
the

stage,
the

removeEffect()

method
will
be
called.
In
both
cases
(button

pressed
during
and
after
the
transition),
a

FLASHEFFEvents.TRANSITION_END

event
will
be
dispatched.


Place
a
dynamic
text
field
on
the
stage,
en
ter
the
text
"The
quick
brown
fox

jumps
over
the
lazy
dog"
into
it
and
give
it
an
instance
name
of
myTextField.
Set

the
anti

alias
setting
to
"Anti

alias
for
animation",
enable
the
"Render
text
as

HTML"
option
and
embed
the
characters
using
the
Auto
Fill
o
ption
in
the
Embed

characters
dialog
box.
Also
place
a
Button
on
the
stage
and
give
it

an
instance

name
of
buttonInstance.
Next,
from
the
Components
panel
drag
the


46

FlashEff2Code
component
and
the
FETAlpha
pattern
into
the
Library.
Bring
up

the
Actions
pan
el
and
paste
the
following
code
into
it:


import com.jumpeye.flashEff2.text.alpha.FETAlpha;

import com.jumpeye.Events.FLASHEFFEvents;


var myPattern:FETAlpha = new FETAlpha();

var myEffect:FlashEff2Code = new FlashEff2Code();

myEffect.hideTransition = myPa
ttern;

myEffect.hideDelay = 1;

myEffect.isTargetVisibleAtEnd = true;

this.addChild(myEffect);

myEffect._targetInstanceName = "myTextField";


buttonInstance.addEventListener(MouseEvent.CLICK,
clikHandler);


function clikHandler(evt:MouseEvent):void {


myEff
ect.removeEffect();

}


myEffect.addEventListener(FLASHEFFEvents.TRANSITION_EN
D, transitionEndHandler);


function
transitionEndHandler(evtObj:FLASHEFFEvents):void {


trace("The transition has ended.");

}


removeFilter

Removes
a
specified
filter
from
the
ta
rget
symbol
or
text.
It
returns
a
Boolean

value
(true)
if
it’s
successful.


Parameters

filter:IFlashEffFilter



The
reference
to
the
filter
pattern
created

separately,
by
code.


removeFromGroupList

Removes
one
of
the
target
objects
used
as
grouped
button

from
the
group
it
is

part
of.


Parameters

target:DisplayObject



The
target
display
object
with
a
button
effect

applied.
If
the
button
is
part
of
a
group,
it
will
be
removed
from
that
group.
The

name
of
the
group
is
specified
on
the
FlashEff2
instance
appl
ied
on
the
target

display
object.


removeHideTransition

Removes
the
last
symbol
or
text
pattern
used
for
the
hide
transition.


removeShowTransition

Removes
the
last
symbol
or
text
pattern
used
for
the
show
transition.


setXML

Allows
setting
up
the
compo
nent
according
to
xml
data
passed
as
parameter.


Parameters

xml:*



The

XML

object
that
contains
setup
information
for
the
FlashEff2Code

component
instance.
It
can
be
either
of
type

XML
,
a
XML
object
created
by
code,

or
of
type

String
,
the
same
xml
data
pa
ssed
as

String

argument.


47


show

Applies
a
show
transition
to
the
target
object,
if
a
symbol
or
text
pattern
has

been
applied
to
it.
If
the
FlashEff2
object
does
not
have
a
symbol
or
text
pattern

applied,
it
will
not
execute
any
actions.


Parameters

forceAu
toHide:*

(default
=

null
)



[optional]
If

true
,
the

show

method

will
execute
a
show
transition
and
then,
force
FlashEff2
to
execute
a

hide

transition
after
the
time
interval
specified
at

hideDelay
,
even
if

hideAutoPlay

is
set
to

false
.
Otherwise,
only
the

show
transition
will
be

executed.


Example

The
next
example
applies
a
show
transition
based
on
the
Alpha
pattern

(FESAlpha),
to
a
clip
(symbol)
called
myClip.
The
show
transition
will
not
execute

automatically
since
the

showAutoPlay

property
is
set
to

fals
e
,
but
it
will

execute
on
mouse
click
over
the
target
clip.


Create
a
movie
clip
on
the
stage
and
give
it
an
instance
name
of
myClip.
Next,

from
the
Components
panel
drag
the
FlashEff2Code
component
and
the

FESAlpha
pattern
into
the
Library.
Bring
up
the
A
ctions
panel
and
paste
the

following
code
into
it:


import com.jumpeye.flashEff2.symbol.alpha.FESAlpha;


var myPattern:FESAlpha = new FESAlpha();

var myEffect:FlashEff2Code = new FlashEff2Code();

myEffect.showTransition = myPattern;

myEffect.showDelay = 0;

myEffect.showAutoPlay = false;

this.addChild(myEffect);

myEffect._targetInstanceName = "myClip";


myClip.addEventListener(MouseEvent.CLICK,
clikHandler);


function clikHandler(evt:MouseEvent):void {


myEffect.show();

}


swap

Applies
the
swap
transition
b
etween
two
target
objects.
The
first
target
object
is

the
one
that
is
currently
visible
and
will
be
hidden
with
a
hide
transition
if

swapType

is

FlashEff2.SWAP_TYPE_HIDE

or

FlashEff2.SWAP_TYPE_HIDE_AND_SHOW
.
The
second
target
object
is
the

one
that
will
be

made
visible
after
the
transition,
using
a
show
transition,
if

swapType

is

FlashEff2.SWAP_TYPE_SHOW

or

FlashEff2.SWAP_TYPE_HIDE_AND_SHOW
.


Parameters

newTarget:DisplayObject

(
default
=

null
)



The
second
target
object

that
will
replace
the
current
target

object.
If
this
is
null,
then
the
object
specified

at

swapTarget

will
be
used.

swType:String

(
default
=

"")



The
type
of
swap
transition
applied.
If
it
is
a

blank
String
(""),
then
the
transition
type
will
be
the
one
specified
at

swapType
.


Example


48

The
ne
xt
example
uses
the

swap()

method
to
apply
a
swap
transition
between

two
text
fields,
by
pressing
on
a
button.
The
example
applies
a
show
transition

based
on
the
Alpha
pattern
(FETAlpha)
to
a
text
field
called
myTextField1
and

then
swaps
the
text
field
wit
h
another
one
called
myTextField2.
The
swap

operation
hides
the
first
text
field
using
the
Blur
pattern
(FETBlur)
and
then

displays
the
second
text
field
at
the
same
time
with
the
Alpha
pattern.


Place
two
dynamic
text
fields
on
the
stage,
enter
the
"This

is
the
first
text
field"

text
into
one
of
them
and
"This
is
the
second
text
field"
text
into
he
other
and

give
them
instance
names
of
myTextField1
for
the
first
text
field
and

myTextField2
for
the
second
one.
Change
the
anti

alias
setting
to
"Anti

alias
fo
r

animation",
enable
the
"Render
text
as
HTML"
option
and
embed
the
characters

using
the
Auto
Fill
option
in
the
Embed
characters
dialog
box
for
both
text
fields.

Next,
place
a
button
on
the
Stage
and
give
it
the
instance
name
of
swapButton.

Finally,
from

the
Components
panel
drag
the
FlashEff2Code
component
and
the

FETAlpha
and
FETBlur
patterns
into
the
Library.
Bring
up
the
Actions
panel
and

paste
the
following
code
into
it:


import com.jumpeye.flashEff2.text.alpha.FETAlpha;

import com.jumpeye.flashEff2.t
ext.blur.FETBlur;


myTextField2.visible = false;


var showPattern1:FETAlpha = new FETAlpha();

var showPattern2:FETAlpha = new FETAlpha();

var hidePattern:FETBlur = new FETBlur();

var myEffect:FlashEff2Code = new FlashEff2Code();


myEffect.targetVisibility
= false;

myEffect.showTransition = showPattern1;

myEffect.hideTransition = hidePattern;


this.addChild(myEffect);

myEffect.swapTargetInstanceName = "myTextField2";

myEffect._targetInstanceName = "myTextField1";


this.addChild(myEffect);

myEffect._targetIns
tanceName = "myTextField1";


swapButton.addEventListener(MouseEvent.CLICK,
makeSwap);


function makeSwap(evtObj:MouseEvent):void {


myEffect.swap(myTextField2,
FlashEff2.SWAP_TYPE_HIDE_AND_SHOW);

}


transitionEffect

Starts
a
show
or
hide
effect,
according

to
the
argument's
value.


Parameters

type:String

(default
=

"
show
"
)



The
type
of
transition
to
be
executed.

Possible
values
are

show

and

hide
.


Example

The
next
example
applies
a
show
transition
based
on
the
Alpha
pattern

(FESAlpha),
to
a
clip
(symbol)
c
alled
myClip.
The
show
transition
will
not
execute

automatically
since
the

showAutoPlay

property
is
set
to

false
,
but
it
will

execute
on
mouse
click
over
the
target
clip.


49


Create
a
movie
clip
on
the
stage
and
give
it
an
instance
name
of
myClip.
Next,

from

the
Components
panel
drag
the
FlashEff2Code
component
and
the

FESAlpha
pattern
into
the
Library.
Bring
up
the
Actions
panel
and
paste
the

following
code
into
it:


import com.jumpeye.flashEff2.symbol.alpha.FESAlpha;


var myPattern:FESAlpha = new FESAlpha();

var myEffect:FlashEff2Code = new FlashEff2Code();

myEffect.showTransition = myPattern;

myEffect.showDelay = 0;

myEffect.showAutoPlay = false;

this.addChild(myEffect);

myEffect._targetInstanceName = "myClip";


myClip.addEventListener(MouseEvent.CLICK,
clik
Handler);


function clikHandler(evt:MouseEvent):void {


myEffect.transitionEffect("show");

}



Events

Event

Description

IOErrorEvent.IO_ERROR

Dispatched
when
the
FlashEff2Code
component
instance
encounters
an
error

while
the
.xml
setup
file
is
being
load
ed.


Example

This
example
sets
up
the
FlashEff2Code
component
instance
from
an
external

.xml
file
and
displays
an
error
message
if
the
.xml
file
cannot
be
read.


Create
a
movie
clip
on
the
stage
and
give
it
an
instance
name
of
myClip.
Next,

from
the
Compon
ents
panel
drag
the
FlashEff2Code
component
and
the

FESAlpha
pattern
into
the
Library.
Bring
up
the
Actions
panel
and
paste
the

following
code
into
it:


import flash.events.IOErrorEvent;

import com.jumpeye.Events.FLASHEFFEvents;


var myEffect:FlashEff2Code
= new FlashEff2Code();

this.addChild(myEffect);

myEffect.xmlPath = "setup.xml";


myEffect.addEventListener(IOErrorEvent.IO_ERROR,
errorHandler);

myEffect.addEventListener(FLASHEFFEvents.COMPLETE,
completeHandler);


function errorHandler(evtObj:IOErrorEven
t):void {


trace("Could not read the XML data !");

}



50

function completeHandler(evtObj:FLASHEFFEvents):void
{


trace("XML data loaded completely");


trace(evtObj.data);

}


FLASHEFFEvents.COMPLETE

Dispatched
when
the
FlashEff2Code
component
instance
is
set

up
from
a
.xml

file
and
the
file
has
been
completely
loaded.
The
event
object
passed
as
an

argument
to
the
event
handler
function
has
a
property
called

data

that
gives

you
access
to
the
XML
object
used
to
set
up
the
component
instance.
This

event
is
dispat
ched
before
the

FLASHEFFEvents.INIT

event.


Example

This
example
sets
up
the
FlashEff2Code
component
instance
from
an
external

.xml
file
and
displays
a
text
when
the
component
finished
reading
the
.xml
file.


Create
a
movie
clip
on
the
stage
and
give
it
an

instance
name
of
myClip.
Next,

from
the
Components
panel
drag
the
FlashEff2Code
component
and
the

FESAlpha
pattern
into
the
Library.
Bring
up
the
Actions
panel
and
paste
the

following
code
into
it:


import flash.events.IOErrorEvent;

import com.jumpeye.Eve
nts.FLASHEFFEvents;


var myEffect:FlashEff2Code = new FlashEff2Code();

this.addChild(myEffect);

myEffect.xmlPath = "setup.xml";


myEffect.addEventListener(IOErrorEvent.IO_ERROR,
errorHandler);

myEffect.addEventListener(FLASHEFFEvents.COMPLETE,
completeHand
ler);


function errorHandler(evtObj:IOErrorEvent):void {


trace("Could not read the XML data !");

}


function completeHandler(evtObj:FLASHEFFEvents):void
{


trace("XML data loaded completely");


trace(evtObj.data);

}


FLASHEFFEvents.INIT

Dispatched
when
t
he
FlashEff2Code
component
completes
the
initialization

process.
This
event
is
dispatched
after
the

FLASHEFFEvents.COMPLETE

event.


Example

This
example
sets
up
the
FlashEff2Code
component
instance
from
an
external

.xml
file
and
displays
a
traced
message
w
hen
the
component
finished

initializing.


Create
a
movie
clip
on
the
stage
and
give
it
an
instance
name
of
myClip.
Next,

from
the
Components
panel
drag
the
FlashEff2Code
component
and
the

FESAlpha
pattern
into
the
Library.
Bring
up
the
Actions
panel
and
pa
ste
the

following
code
into
it:



51

import com.jumpeye.Events.FLASHEFFEvents;


var myEffect:FlashEff2Code = new FlashEff2Code();

this.addChild(myEffect);

myEffect.xmlPath = "setup.xml";


myEffect.addEventListener(FLASHEFFEvents.INIT,
initHandler);


function i
nitHandler(evtObj:FLASHEFFEvents):void {


trace(evtObj.target+" finished initializing.");

}


FLASHEFFEvents.DOUBLE_CLICK

Dispatched
by
the
FlashEff2Code
component
when
the
target
object
has
been

clicked
twice
(double
click
action).


Example

The
next
examp
le
applies
a
show
transition
based
on
the
Alpha
pattern

(FESAlpha),
to
a
clip
(symbol)
called
myClip.
The
show
transition
will
be

executed
with
a
2
second
delay
and
the
FlashEff2Code
component
instance

will
dispatch
the
mouse
events
executed
on
the
target

clip.


Create
a
movie
clip
on
the
stage
and
give
it
an
instance
name
of
myClip.
Next,

from
the
Components
panel
drag
the
FlashEff2Code
component
and
the

FESAlpha
pattern
into
the
Library.
Bring
up
the
Actions
panel
and
paste
the

following
code
into
it:


im
port com.jumpeye.Events.FLASHEFFEvents;

import com.jumpeye.flashEff2.symbol.alpha.FESAlpha;


var myPattern:FESAlpha = new FESAlpha();

var myEffect:FlashEff2Code = new FlashEff2Code();

myEffect.showTransition = myPattern;

myEffect.showDelay = 2;

this.addChi
ld(myEffect);

myEffect._targetInstanceName = "myClip";


myEffect.addEventListener(FLASHEFFEvents.DOUBLE_CLICK
, dblClickHandler);


function dblClickHandler(evtObj:FLASHEFFEvents):void
{


trace("DOUBLE CLICK on target object");

}


FLASHEFFEvents.MOUSE_DOWN

Dispatched
by
the
FlashEff2Code
component
when
a
mouse
button
has
been

pressed
on
the
target
object.


Example

The
next
example
applies
a
show
transition
based
on
the
Alpha
pattern

(FESAlpha),
to
a
clip
(symbol)
called
myClip.
The
show
transition
will
be

ex
ecuted
with
a
2
second
delay
and
the
FlashEff2Code
component
instance

will
dispatch
the
mouse
events
executed
on
the
target
clip.


Create
a
movie
clip
on
the
stage
and
give
it
an
instance
name
of
myClip.
Next,

from
the
Components
panel
drag
the
FlashEff2Co
de
component
and
the

FESAlpha
pattern
into
the
Library.
Bring
up
the
Actions
panel
and
paste
the


52

following
code
into
it:


import com.jumpeye.Events.FLASHEFFEvents;

import com.jumpeye.flashEff2.symbol.alpha.FESAlpha;


var myPattern:FESAlpha = new FESAlpha()
;

var myEffect:FlashEff2Code = new FlashEff2Code();

myEffect.showTransition = myPattern;

myEffect.showDelay = 2;

this.addChild(myEffect);

myEffect._targetInstanceName = "myClip";


myEffect.addEventListener(FLASHEFFEvents.MOUSE_DOWN,
mouseDownHandler);

myEf
fect.addEventListener(FLASHEFFEvents.MOUSE_UP,
mouseUpHandler);


function mouseDownHandler(evtObj:FLASHEFFEvents):void
{


trace("MOUSE DOWN on target object");

}


function mouseUpHandler(evtObj:FLASHEFFEvents):void {


trace("MOUSE UP on target object");

}


FLASHEFFEvents.MOUSE_UP

Dispatched
by
the
FlashEff2Code
component
when
a
mouse
button
has
been

released
over
the
target
object,
regardless
of
whether
the
mouse
down
action

has
happened
to
the
target
object
or
on
another
DisplayObject.


Example

The
next
e
xample
applies
a
show
transition
based
on
the
Alpha
pattern

(FESAlpha),
to
a
clip
(symbol)
called
myClip.
The
show
transition
will
be

executed
with
a
2
second
delay
and
the
FlashEff2Code
component
instance

will
dispatch
the
mouse
events
executed
on
the
tar
get
clip.


Create
a
movie
clip
on
the
stage
and
give
it
an
instance
name
of
myClip.
Next,

from
the
Components
panel
drag
the
FlashEff2Code
component
and
the

FESAlpha
pattern
into
the
Library.
Bring
up
the
Actions
panel
and
paste
the

following
code
into
it:


import com.jumpeye.Events.FLASHEFFEvents;

import com.jumpeye.flashEff2.symbol.alpha.FESAlpha;


var myPattern:FESAlpha = new FESAlpha();

var myEffect:FlashEff2Code = new FlashEff2Code();

myEffect.showTransition = myPattern;

myEffect.showDelay = 2;

this.ad
dChild(myEffect);

myEffect._targetInstanceName = "myClip";


myEffect.addEventListener(FLASHEFFEvents.MOUSE_DOWN,
mouseDownHandler);

myEffect.addEventListener(FLASHEFFEvents.MOUSE_UP,
mouseUpHandler);


function mouseDownHandler(evtObj:FLASHEFFEvents):void
{


trace("MOUSE DOWN on target object");


53

}


function mouseUpHandler(evtObj:FLASHEFFEvents):void {


trace("MOUSE UP on target object");

}


FLASHEFFEvents.ROLL_OVER

Dispatched
by
the
FlashEff2Code
component
when
the
mouse
rolls
over
the

target
object's
surfa
ce.


Example

The
next
example
applies
a
show
transition
based
on
the
Alpha
pattern

(FESAlpha),
to
a
clip
(symbol)
called
myClip.
The
show
transition
will
be

executed
with
a
2
second
delay
and
the
FlashEff2Code
component
instance

will
dispatch
the
mouse
eve
nts
executed
on
the
target
clip.


Create
a
movie
clip
on
the
stage
and
give
it
an
instance
name
of
myClip.
Next,

from
the
Components
panel
drag
the
FlashEff2Code
component
and
the

FESAlpha
pattern
into
the
Library.
Bring
up
the
Actions
panel
and
paste
the

following
code
into
it:


import com.jumpeye.Events.FLASHEFFEvents;

import com.jumpeye.flashEff2.symbol.alpha.FESAlpha;


var myPattern:FESAlpha = new FESAlpha();

var myEffect:FlashEff2Code = new FlashEff2Code();

myEffect.showTransition = myPattern;

myEffect
.showDelay = 2;

this.addChild(myEffect);

myEffect._targetInstanceName = "myClip";


myEffect.addEventListener(FLASHEFFEvents.ROLL_OVER,
rollOverHandler);

myEffect.addEventListener(FLASHEFFEvents.ROLL_OUT,
rollOutHandler);


function rollOverHandler(evtObj:FL
ASHEFFEvents):void
{


trace("ROLL OVER on target object");

}


function rollOutHandler(evtObj:FLASHEFFEvents):void {


trace("ROLL OUT on target object");

}


FLASHEFFEvents.ROLL_OUT

Dispatched
by
the
FlashEff2Code
component
when
the
mouse
rolls
out
of
the

t
arget
object's
surface.


Example

The
next
example
applies
a
show
transition
based
on
the
Alpha
pattern

(FESAlpha),
to
a
clip
(symbol)
called
myClip.
The
show
transition
will
be

executed
with
a
2
second
delay
and
the
FlashEff2Code
component
instance

will
di
spatch
the
mouse
events
executed
on
the
target
clip.


Create
a
movie
clip
on
the
stage
and
give
it
an
instance
name
of
myClip.
Next,

from
the
Components
panel
drag
the
FlashEff2Code
component
and
the

FESAlpha
pattern
into
the
Library.
Bring
up
the
Actions

panel
and
paste
the

following
code
into
it:


54


import com.jumpeye.Events.FLASHEFFEvents;

import com.jumpeye.flashEff2.symbol.alpha.FESAlpha;


var myPattern:FESAlpha = new FESAlpha();

var myEffect:FlashEff2Code = new FlashEff2Code();

myEffect.showTransition =
myPattern;

myEffect.showDelay = 2;

this.addChild(myEffect);

myEffect._targetInstanceName = "myClip";


myEffect.addEventListener(FLASHEFFEvents.ROLL_OVER,
rollOverHandler);

myEffect.addEventListener(FLASHEFFEvents.ROLL_OUT,
rollOutHandler);


function rollO
verHandler(evtObj:FLASHEFFEvents):void
{


trace("ROLL OVER on target object");

}


function rollOutHandler(evtObj:FLASHEFFEvents):void {


trace("ROLL OUT on target object");

}


FLASHEFFEvents.TRANSITION_END

Dispatched
by
the
FlashEff2Code
component
when
th
e
transition
of
a
symbol

or
text
pattern
has
ended.


Example

The
next
example
applies
a
show
transition
based
on
the
Alpha
pattern

(FESAlpha),
to
a
clip
(symbol)
called
myClip.
The
FlashEff2Code
component

instance
will
dispatch
events
when
the
transition
s
tarts
and
when
it
ends.


Create
a
movie
clip
on
the
stage
and
give
it
an
instance
name
of
myClip.
Next,

from
the
Components
panel
drag
the
FlashEff2Code
component
and
the

FESAlpha
pattern
into
the
Library.
Bring
up
the
Actions
panel
and
paste
the

following

code
into
it:


import com.jumpeye.flashEff2.symbol.alpha.FESAlpha;

import com.jumpeye.Events.FLASHEFFEvents;


var myPattern:FESAlpha = new FESAlpha();

var myEffect:FlashEff2Code = new FlashEff2Code();

myEffect.showTransition = myPattern;

this.addChild(myE
ffect);

myEffect._targetInstanceName = "myClip";


myEffect.addEventListener(FLASHEFFEvents.TRANSITION_S
TART, transitionStartHandler);

myEffect.addEventListener(FLASHEFFEvents.TRANSITION_E
ND, transitionEndHandler);


function
transitionStartHandler(evtObj:FL
ASHEFFEvents):void {


trace("The transition has started.");

}


function
transitionEndHandler(evtObj:FLASHEFFEvents):void {


55


trace("The transition has ended.");

}


FLASHEFFEvents.TRANSITION_START

Dispatched
by
the
FlashEff2Code
component
when
the
transitio
n
of
a
symbol

or
text
pattern
has
started.


Example

The
next
example
applies
a
show
transition
based
on
the
Alpha
pattern

(FESAlpha),
to
a
clip
(symbol)
called
myClip.
The
FlashEff2Code
component

instance
will
dispatch
events
when
the
transition
starts
and

when
it
ends.


Create
a
movie
clip
on
the
stage
and
give
it
an
instance
name
of
myClip.
Next,

from
the
Components
panel
drag
the
FlashEff2Code
component
and
the

FETAlpha
pattern
into
the
Library.
Bring
up
the
Actions
panel
and
paste
the

following
code
int
o
it:


import com.jumpeye.flashEff2.text.alpha.FETAlpha;

import com.jumpeye.Events.FLASHEFFEvents;


var myPattern:FETAlpha = new FETAlpha();

var myEffect:FlashEff2Code = new FlashEff2Code();

myEffect.showTransition = myPattern;

this.addChild(myEffect);

myE
ffect._targetInstanceName = "myTextField";


myEffect.addEventListener(FLASHEFFEvents.TRANSITION_S
TART, transitionStartHandler);

myEffect.addEventListener(FLASHEFFEvents.TRANSITION_E
ND, transitionEndHandler);


function
transitionStartHandler(evtObj:FLASHEFF
Events):void {


trace("The transition has started.");

}


function
transitionEndHandler(evtObj:FLASHEFFEvents):void {


trace("The transition has ended.");

}