Hi Aral,
This doesn't look like a bug to me.
You are effectively creating a sub-class with the same class members as its
base class contains (set the keep-generated flag when you compile and you'll
see that) and the Flex compiler is correctly warning you of that.
Taking MXML out of the equation (and simplified), here's what you're really
doing:
class com.ariaware.pizza.view.Application extends mx.core.Application
{
...
private var orderForm:OrderForm;
...
class AprPizza extends com.ariaware.pizza.view.Application
{
...
public var orderForm:OrderForm;
...
So, you are hiding the base class member.
Is there really a need to have the same class members in both the base class
and the sub-class? If you explain what you're trying to do, we may be able
to offer alternatives.
Cheers,
Ali
--
Alistair McLeod
Development Director
iteration::two
[EMAIL PROTECTED]
Office: +44 (0)131 338 6108
Mobile: +44 (0)7976 987252
This e-mail and any associated attachments transmitted with it may contain
confidential information and must not be copied, or disclosed, or used by
anyone other than the intended recipient(s). If you are not the intended
recipient(s) please destroy this e-mail, and any copies of it, immediately.
Please also note that while software systems have been used to try to ensure
that this e-mail has been swept for viruses, iteration::two do not accept
responsibility for any damage or loss caused in respect of any viruses
transmitted by the e-mail. Please ensure your own checks are carried out
before any attachments are opened.
-----Original Message-----
From: Aral Balkan [mailto:[EMAIL PROTECTED]
Sent: 05 April 2005 12:54
To: [email protected]
Subject: [flexcoders] Bug report: Incorrect hidden member in ancestor class
warnings
Hi all,
Sorry I haven't had the chance to report this sooner but it appears that
Flex issues incorrect warnings when you extend the core Application and/or
Form classes and try to reference a component both in MXML and AS.
Case in point:
// ArpPizza.mxml
<pizzaView:Application
xmlns:pizzaView="com.ariaware.pizza.view.*"
xmlns:mxml="*"
xmlns:mx="http://www.macromedia.com/2003/mxml"
backgroundImage="@Embed('Graphics/design.gif')"
// ...
>
<mx:Canvas width="550" height="400">
<mx:LinkBar id="linkBar" x="360" y="14" />
<mx:ViewStack id="screens" x="38" y="59">
<mxml:OrderForm id="orderForm" label="Order Form" />
<mxml:ViewOrdersForm id="viewOrdersForm" label="View Orders" />
</mx:ViewStack>
// ...
Note: ViewStack contains the two forms with ids set to orderForm and
viewOrdersForm.
class com.ariaware.pizza.view.Application extends mx.core.Application {
//
// On stage
//
private var screens:mx.containers.ViewStack;
private var linkBar:mx.containers.LinkBar;
private var orderForm:OrderForm;
private var viewOrdersForm:ViewOrdersForm;
private var dataPreloader:ProgressBar;
// etc.
* * *
Actual behavior:
4 Warnings found.
Warning /ArpPizza.mxml:22
The member, viewOrdersForm, hides a member in ancestor class,
'com.ariaware.pizza.view.Application'.
Warning /ArpPizza.mxml:21
The member, orderForm, hides a member in ancestor class,
'com.ariaware.pizza.view.Application'.
Warning /ArpPizza.mxml:22
The member, viewOrdersForm, hides a member in ancestor class,
'com.ariaware.pizza.view.Application'.
Warning /ArpPizza.mxml:21 The member, orderForm, hides a member in ancestor
class, 'com.ariaware.pizza.view.Application'.
* * *
Expected behavior: No warnings should be given as we are not hiding a member
(we are simply referring to the same member, once in MXML and once in AS2.)
This is exactly what we do in Flash when we give a component an instance
name and then declare it in the form's class.
I know the Flex MM team frequent this forum so I thought I'd send this over
here. If you need the full app to test with, just let me know.
Thanks,
Aral
Yahoo! Groups Links
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/