Oops, missed that, yes, the file name and class name must match.

Tracy

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Doug Lowder
Sent: Wednesday, April 25, 2007 6:45 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Code Behind Woes

 

Tracy, I'm assuming you have class MIPApplication defined in a file 
named MIPApplication.as. The original poster was defining class 
myClass in file myClassBase.as, which I don't think will compile; 
correct?

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> "you cannot extend Application" , no, you can defintely do this. 
The
> limitation is that the subclass can only appear at the root of an 
mxml
> file.
> 
> I don't see what is wrong in the posted code. This is an example 
tht is
> very similar and is working for me:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <mipc:MIPApplication 
> xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> "
> xmlns:mipc="MIPContainers.*" 
> app="{this}" >
> <mx:Style source="mip.css" />
> </mipc:MIPApplication>
> 
> And MIPApplication.as starts off like this:
> package MIPContainers
> {
> import mx.core.Application;
> ...
> public class MIPApplication extends le_MIP
> {
> "le_MIP" is an mxml application. Hmm, I am always extending an mxml
> application, not the "Application" class, I wonder if that is the
> difference?
> Tracy
> 
> -----Original Message-----
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>

[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of Dimitrios Gianninas
> Sent: Tuesday, April 24, 2007 11:47 PM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: RE: [flexcoders] Re: Code Behind Woes
> 
> I believe Doug is right, you will have to make sure the name of your
> MXML component and AS class are different. But even at that, you 
cannot
> extend Application because by doing so it will not generate the
> appropriate hidden code at compile time to make your app work. What 
u
> should do is extends Box, Panel, etc... and then drop those into 
your
> app.
> 
> Dimitrios Gianninas
> Optimal Payments Inc.
> 
> 
> 
> -----Original Message-----
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
on behalf of Doug Lowder
> Sent: Tue 4/24/2007 5:37 PM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Re: Code Behind Woes
> 
> File name/class name mismatch? I think you'll need to either 
change 
> your class name to "myClassBase", or change the filename 
> to "myClass.as".
> 
> --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> , "Jim Grinsfelder" <jim@> wrote:
> >
> > I'm confused again. I read Ted's thing on Code Behind and got 
all 
> excited.
> > 
> > 
> > 
> > 
> > Now I'm getting "Unable to locate specified base 
> class 'app.myClass' for
> > component class 'myClass' when I build the following:
> > 
> > 
> > 
> > 
> > 
> > [file: myClassBase.as]
> > 
> > package app
> > 
> > {
> > 
> > import mx.core.Application;
> > 
> > 
> > 
> > public class myClass extends Application
> > 
> > {
> > 
> > }
> > 
> > }
> > 
> > 
> > 
> > 
> > 
> > [file: myclass.mxml]
> > 
> > <?xml version="1.0" encoding="utf-8"?>
> > 
> > <app:myClass xmlns:app="app.*" 
> xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> "
> > layout="absolute">
> > 
> > 
> > 
> > </app:myClass>
> > 
> > 
> > 
> > 
> > 
> > What did I neglect to do?
> >
>

 

Reply via email to