1. The sprite class can
In order to directly plot in the as Project
On the screen.
2. The interface does not match.
To display Sprite, you can
To use uicompo
NENT packaging, for example
For example
Mxml code
VaR COMP: uicomponen
T = new uicomponen
T ();
Comp. addch
ILD (sprite
Object );
Hbox. addch
ILD (COMP );
Mxml code
VaR COMP: uicomponen
T = new uicomponen
T ();
Comp. addch
ILD (sprite
Object); hbox. addch
ILD (COMP );
If sprite contains
Other Sprite, only
Top SP to be packaged
Rite.
For some reason (the original fl
Migrate ash to flex
), Directly in the FLE
Add sprite to X
Class (or inherit from sprit
E), but directly
Joining Sprite is
Not allowed, mainly because
Only IUIC is implemented.
Omponent Interface
Class can be flex Group
Component Architecture acceptance, as a component
.
Display element in flex
The inheritance relationship is as follows:
Uicomponen
T
-> Flexsprite
-> Sprite-> displayobj
Ectcontain
Er
-> ....
Therefore, Sprite cannot
Directly add to flex
But you can use the following method:
To join, so you do not need
Modified the original design architecture.
:
For example, there is a sprit
E needs to be added to flex
Medium:
Code:
VaR sprite: SPR
ITE = new sprite ();
VaR
UIC: uicomp
Onent = new
Uicomponen
T ();
UIC. addchi
LD (sprite)
;
Addchild (u
Ic );
In this way, Sprite can
To be added to flex,
The principle is uicompo.
NENT implements IUI
Component connection
Class.
For flex and spri
Te bridge, all S
All prite classes can be connected
Such easy addition to F
Lex architecture.
Or modify Sprite.
Uicompone
NT.