Hello,

I already commented this but the message appears to have 
disappeared - another try.

Explanation:
In the Application AS file, the prototype of a standard class A is 
manipulated so that the class has event E. The event is dispatched 
with "this.dispatchEvent({target:this,type:"E",...}); 

Now if I specify an event handler in an MXML file like <mx:A id="id" 
E="doSomething()"/>, everything works just fine.

But: I also want to use class B which extends class C extending 
class A, ie. B is a subclass of A. If I write like before <mx:B 
id="id" E="doSomethingElse()"/>, the compiler says that the E 
attribute is unknown.

So, this E event has to be declared all over again for class B?? 
What exactly does this mean?

Satu
 

--- In [email protected], "Matt Chotin" <[EMAIL PROTECTED]> 
wrote:
> All [Event] metadata is inherited by the subclass so you shouldn't 
have
> any problems.  But you can't dispatch the event, you have to have 
it
> declared on the class definition for MXML to pick it up.
> 
>  
> 
> Matt
> 
>  
> 
> ________________________________
> 
> From: [email protected] 
[mailto:[EMAIL PROTECTED] On
> Behalf Of svktiilikainen
> Sent: Monday, August 01, 2005 1:48 AM
> To: [email protected]
> Subject: [flexcoders] Custom event & inheritance
> 
>  
> 
> Hi all,
> 
> how should a custom event be used in subclasses? 
> 
> I have a custom event specified in the prototype of an AS class, 
say 
> ScrollSelectList. Now I want to use the event in an instance of a 
> subclass of ScrollSelectList, say DataGrid. If I just write 
something 
> like 
> <mx:DataGrid id="myGrid" event-name="function-name">,
> 'event-name' being the event to catch, Flex throws an error
> "unknown attribute 'event-name' on myGrid".
> The event handling works just fine when used in the parent 
> (ScrollSelectList) class instance.
> 
> Should the event be declared somehow for subclass as well?
> 
> Thanks, 
> Satu
> 
> 
> 
> 
> --
> 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 
> 
>  
> 
> *      Visit your group "flexcoders
> <http://groups.yahoo.com/group/flexcoders> " on the web.
>         
> *      To unsubscribe from this group, send an email to:
>        [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]
subject=Unsubscribe> 
>         
> *      Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/> . 
> 
>  
> 
> ________________________________





------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12h3fusvu/M=362131.6882499.7825260.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1122993044/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life 
- brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~-> 

--
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/
 



Reply via email to