Try changing the namespace of your Beta class... it's "possible" it's choking on the "alpha" since it's a property on UIComponent.  *If memory servers*




On 7/21/05, alandouglasgray <[EMAIL PROTECTED]> wrote:
Hi,
I have a most puzzling problem (at least to me).
I get the followinf error "Instance variables and functions may not be
used to initialize static variables." when I try to extend the
mx.controls.Label class in an AS file under a package but not when it
is at the root.  To explain: I have a brand new Flex web app, nothing
else in it other than the files in question.  My app has one mxml file:

\mystuff\main.mxml

<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
xmlns="*" xmlns:greek="alpha.*">
<mx:Panel width="400" height="400" >
<Delta/>
<greek:Beta/>
</mx:Panel>
</mx:Application>

and two classes:

\mystuff\WEB-INF\flex\user_classes\Delta.as

import mx.controls.Label;
class Delta extends mx.controls.Label
{
        public function Delta() {
                text = "Delta";
        }
}

\mystuff\WEB-INF\flex\user_classes\alpha\Beta.as

import mx.controls.Label;

class alpha.Beta extends mx.controls.Label
{
        public function Beta() {
                text = "Beta";
        }
}

My app works with just main.mxml and Delta.as but as soon as I include
Beta.as I get the aforementioned error.  As you can see the classes
are essentially identical other than the package declaration and their
respective locations.  As far as I can tell the namespace declarations
in the mxml file are correct.

Can anybody shed some light on what the problem is?

Oh and my flex-config.xml contains the section

    <compiler>
       ...
        <!-- path locations of actionscript class files -->
        <actionscript-classpath>
            <path-element>/WEB-INF/flex/user_classes</path-element>
        </actionscript-classpath>
       ...
    </compiler>


Regards,
Alan




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
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/






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Computer software testing Macromedia flex Development
Software developer


YAHOO! GROUPS LINKS




Reply via email to