this is what i ended up doing. lets take your event class as an example you have all the constants declared on it for the different type of events that is grouped under the base event (ENTER_FRAME etc) and this is all good. however if i have a bunch of classes that don't all extent a single object, but all implement the same interface i have to create a seperate class for all the EventTypes in associated with it. this was what i was trying to avoid by having the event types dispatched by this interface implementations declared as static constants in the interface itself.

i also considered doing this on package level, but you canj only have 1 externally visible member in a file, why is this?

hwoever this is not a such a bad thing and i can live with it :)

On 2/12/06, Matt Chotin <[EMAIL PROTECTED]> wrote:

I think the language folks decided that constants just won't be in interfaces.  Use a class with static consts instead.  I'm not sure that the Java folks these days ended up feeling like constants in interfaces was so grand anyway.

 

Matt

 


From: [email protected] [mailto: [email protected]] On Behalf Of Johannes Nel
Sent: Friday, February 10, 2006 12:14 PM
To: [email protected]
Subject: Re: [flexcoders] declaring constants in an interface

 

no access identifiers in interfaces give an error and then its the const that is the main error

On 2/10/06, Manish Jethani < [EMAIL PROTECTED]> wrote:

On 2/10/06, Johannes Nel < [EMAIL PROTECTED]> wrote:


>     public interface IStream  extends IEventDispatcher{
>         const UPDATED:String ="streamUpdated";
[snip]

> getting the error "variable declarations are not permitted in interfaces". but a constant is not a variable, its set at compile time so why is this not allowed?

Does declaring it as "static" help?


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





--
j:pn



--
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
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS






--
j:pn


--
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
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to