|
Excuse me for the late reply, but you are coming across a
known limitation when creating an MXML component that uses a container as its
base tag. If you define the mxml component to contain a child, you cannot add a
child to it when you use the tag. In order to be able to add children to
panel.mxml, you must not define any children within the definition. Here's the
doc on it:
Stephen From: Erik Westra [mailto:[EMAIL PROTECTED] Sent: Thursday, April 07, 2005 11:03 AM To: [email protected] Subject: RE: [flexcoders] ActionScript Components Well, flex is whining about subclassing mxml components
wich have children with other mxml components containing
children:
The component
mx.controls.Button may not be used as a child of erik.extend.panel because the
erik.extend.panel is a container with internal children.
[panel.mxml]
<mx:Panel xmlns:mx="http://www.macromedia.com/2003/mxml">
<mx:Button label="crazy" /> </mx:Panel> [panelSub.mxml]
<panel xmlns:mx="http://www.macromedia.com/2003/mxml"
xmlns="erik.extend.*">
<mx:Button label="yellow" /> </panel> Greetz
Erik
From: JesterXL [mailto:[EMAIL PROTECTED] Sent: donderdag 7 april 2005 16:48 To: [email protected] Subject: Re: [flexcoders] ActionScript Components Can you be more specific? I don't have any
problems sub-classes my MXML components.
----- Original Message -----
From: Erik Westra
Sent: Thursday, April 07, 2005 5:42 AM
Subject: RE: [flexcoders] ActionScript Components A good reason to make pure actionscript components is that
they can be subclassed.
When u create an mxml component, u cant extends a custom
mxml component wich has children.
Greetz Erik From: Gordon Smith [mailto:[EMAIL PROTECTED] Sent: donderdag 7 april 2005 9:04 To: '[email protected]' Subject: RE: [flexcoders] ActionScript Components It is
essentially a matter of preference. There are no performance differences that I
know of.
I
generally recommend creating components in MXML because it makes several
things easier, such as creating internal subcomponents, laying them out, and
assigning event handlers to them. For example, if I was creating a
LoginPanel, I would certainly do it in MXML.
Can
you explain what is "a bit messy" about MXML components?
-
Gordon
Yahoo! Groups Links
|
Title: Message

