Hi, Mike.

 

The 'bubbles' property makes the event bubble up from child DisplayObject to parent DisplayObject. It has no meaning for events that aren't dispatched by a DisplayObject. In that case you'd have to redispatch it yourself to another object.

 

- Gordon

 


From: [email protected] [mailto:[email protected]] On Behalf Of Michael Schmalle
Sent: Tuesday, March 07, 2006 4:35 AM
To: [email protected]
Subject: Re: [flexcoders] polymorphic interfaces

 

Hello Gordon,

My bad, I was having a weird problem with events.

Am I misunderstanding or do the bubbles property only apply to DisplayObject's ? That is what it says in the docs. The events bubble through the displayList.

A question, can you use bubbles with a class framework? This class is not connected to DisplayObject just EventDispatcher. I tried using bubbles and I guess I am missing the point when it comes to non-DisplayObjects.

The problem I had was;

- I am using an amf service class,
- this class dispatches a loaded event
- then the listener of the service grabs that event say the Project class

Can I have a class that hooks a loaded listener to the Project instance and use bubbles without redispatching the ResultEvent from the Project class?

I relaize the implementation of clone() now but, it was due to the error above that Flex said cannot coerce flash.events.Event to com.teotigraphix.events.ResultEvent.

I had to end up making a new event using clone() and pass it on, then the compiler didn't care. But in the method of the stack just before the erorr I traced an "is" and flex said it was a ResultEvent.

This is what confused me.

Peace, Mike
-

On 3/7/06, Matt Chotin <[EMAIL PROTECTED]> wrote:

I realize that folks are frustrated that you can't change parameters in subclasses, but I want to make sure everyone realizes that in other languages you are always adding new functionality when you change the parameter types, you are not overriding the methods.  Take this simple Java example:

 

class Superclass

{

    public void print(Object obj)

    {

        System.out.println("Object print: " + obj);

    }

}

 

class Subclass extends Superclass

{

   

    public void print(String str)

    {

       System.out.println("String print: " + str);

    }

   

}

 

In this example the superclass has a print method that takes an Object and the subclass has the same print method but taking a String.  Will the subclass's method be called if I pass in a string?  The answer depends on the type of the variable of the instance when I call print.

 

        String str = "blah";

        Superclass inst = new Superclass();

        inst.print(str);

        inst = new Subclass();

        inst.print(str);

        System.out.println("---");

        Subclass sub = new Subclass();

        sub.print(str);

 

Output:

Object print: blah

Object print: blah

---

String print: blah

 

When the variable was typed as the superclass, regardless of whether the instance was the superclass or subclass the superclass method was called.  I had to have my instance typed as the subclass for the new method to be reached.

 

And what if we do:

Object obj = "string typed as object";

sub.print(obj);

 

Guess what, it prints the Object version even though the actual value is a String.

 

So let's be clear that polymorphism is not really coming into play here.  You would still need to have the strongly typed reference to the subclass to accurately access the new functionality.  And if that's the case, having a different method name than the superclass isn't such a big deal IMHO.

 

Now the ability to overload the parameters is certainly something I wish we supported…

 

Matt

 


From: [email protected] [mailto: [email protected]] On Behalf Of Johannes Nel
Sent: Monday, March 06, 2006 4:15 PM
To: [email protected]
Subject: Re: [flexcoders] polymorphic interfaces

 

i kinda walked the other way and excluyded this method from the interdface since i want each class to return its type (its a semantic argument but it hink a clone method should return the correct type and not some base type)

On 3/6/06, Michael Schmalle <[EMAIL PROTECTED]> wrote:

Hello,

This is funny becasue I was just having this problem with the Event clone() ! :)

I guess I just slammed it with a coerrsion for now.(Yeah I realize this is not an interface but it's the same idea :: you can't override a return type)

But, yeah, I second this motion for the futrue!

Peace, Mike

 

On 3/6/06, Gordon Smith < [EMAIL PROTECTED]> wrote:

I think there's general agreement here that we want to do this in a future release, but that the schedule doesn't allow it for this release. There are quite a few other things that people want as well -- strongly-typed array, enums, inner classes, etc. -- but we can't open up the feature set again this late in the cycle (nearly Beta 2).

 

- Gordon

 


From: [email protected] [mailto:[email protected]] On Behalf Of Johannes Nel
Sent: Monday, March 06, 2006 1:12 PM
To: [email protected]
Subject: [flexcoders] polymorphic interfaces

 

hi all, especially Adobe dudes working on ze language.

the fact that method signatures are not polymorphic when implementing an interface or overriding a function is a real pain in the .... behind.
now in my interface i have to create a function as such

interface IBla
{

function clone():IBla
}

but two levels down the line when i have extended this interface with another i want my clone to return a more concrete type, and then each of my classes that implement this interface their clone methods would ideally return their own type.

yet all these classes implement IBla in some fashion either directly or indirectly so... anyway polymorphic function signatures would be nice.

thanks
johan
--

--
What goes up, does come down.



--
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
http://www.lennel.org



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

 

 





--
What goes up, does come down.


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