You can do either.  We tend to do it mix-in style for 1.5. 

 

Matt

 


From: [email protected] [mailto:[email protected]] On Behalf Of Stacey Mulcahy
Sent: Thursday, January 26, 2006 10:00 AM
To: [email protected]
Subject: RE: [flexcoders] ChangeEvent

 

Do you have to declare the dispatchEvent as a var ( private var dispatchEvent:Function) – like usual for mixins? Or have to extend the dispatcher Class?

 

 

 


From: [email protected] [mailto:[email protected]] On Behalf Of Carolyn Cole
Sent: Thursday, January 26, 2006 10:51 AM
To: [email protected]
Subject: RE: [flexcoders] ChangeEvent

 

Hi Matt!

Good thought, I tried that first, since the example show you doing it that way.  Unfortunately I get the following error:

                 There is no method with the name 'dispatchEvent'.

Any other ides would be appreciated!

-- Carolyn

At 11:14 PM 1/25/2006, Matt Chotin wrote:

Take out the dispatcher.dispatchEvent, just leave it as dispatchEvent.
You don't need a dispatcher property at all.

Matt

-----Original Message-----
From: [email protected] [ mailto:[email protected]] On
Behalf Of Carolyn Cole
Sent: Monday, January 23, 2006 6:59 AM
To: [email protected]
Subject: [flexcoders] ChangeEvent

Hello!

I am trying to get a change event working on a value object, but I just
can
not seem to get a change to occur.

Does anyone have a working example using Chnage Event?

Here is the code I have so far....

import mx.events.*;

// ActionScript Document
[ChangeEvent("configNameChanged")]

class edu.psu.uaim.data.Configuration
{
      public var currentConfig: XML;
      private var _configName: String = null;
      private var dispatcher:EventDispatcher;
     
    private static function staticConstructor():Boolean {
       EventDispatcher.initialize(Configuration.prototype);
       return true;
    }

    // Load an EventDispatcher
    private static var EventDispatcherDependency = EventDispatcher;

    private static var staticConstructed:Boolean = staticConstructor();

      [ChangeEvent("configNameChanged")]
      public function get configName(): String {
            Echo.debug("Config Name Get");
            if ((_configName == null) && (currentConfig!=null) &&
(currentConfig!=undefined)){
                  var node:XMLNode =
lookup("configuration.configName");
                  _configName = node.firstChild.nodeValue;
            }
            return _configName;
      }
     
      public function set configName(name: String): Void {
            _configName = name;
            setText("configuration.configName", name);
             dispatcher.dispatchEvent({type:"configNameChanged"});
      }
}



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








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

 






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