Question about adding sprite-based components in flex

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.