Hello :) To test mx.events.EventDispatcher, GDispatcher, Vegas... the best solution is to test all model :)
In big project with FrontController, MVC etc.. my framework is very interesting... if you want just create a little communication between 2 objects AsBroadcaster is very good :) In Vegas you can try my EDispatcher.as<http://svn.riaforge.org/vegas/AS2/trunk/src/vegas/events/EDispatcher.as>(an old adaptation of the mx.events.EventDispatcher class ;)) ..You can use my native EDispatcher implementation with the package vegas.events.type : http://svn.riaforge.org/vegas/AS2/trunk/src/vegas/events/type/ Example : import vegas.events.type.BasicDispatcher ; /** * This class extends Object and contains addEventListener, removeEventListener, dispatchEvent etc. methods implemented in the interface IDispatcher */ class MyClass extends BasicDispatcher { function MyClass() { } public function getX():Number { return _x ; } public function setX( value:Number ):Void { _x = value ; var event = { type : "onX" , target:this, x:_x } ; dispatchEvent(event) ; } private var _x:Number ; } you can try too my class FastDispatcher with a AsBroadcaster implementation with typed events : http://svn.riaforge.org/vegas/AS2/trunk/src/vegas/events/FastDispatcher.as import vegas.events.Event ; import vegas.events.FastDispatcher ; function onTest( ev:Event ):Void { trace ("--------") ; trace ("type : " + ev.getType()) ; trace ("target : " + ev.getTarget()) ; trace ("context : " + ev.getContext()) ; trace ("this : " + this) ; } var oFD:FastDispatcher = new FastDispatcher() ; trace ("addListener this : " + oFD.addListener(this)) ; trace ("hasListeners : " + oFD.hasListeners()) ; trace ("size : " + oFD.size()) ; oFD.dispatch( { type : "onTest", target : this } ) ; oFD.removeAllListeners() ; oFD.dispatch( { type : "onTest", target : this } ) ; ... my framework implement 3 event models.. but the vegas.events.EventDispatcher is more complete... with EventListener, Event, EventTarget interface etc.. EKA+ :) 2006/11/30, Matthias Dittgen <[EMAIL PROTECTED]>:
You guys are right, I have mixed two questions into one: 1: properties in AS1/AS2 2: watching properties, EventModel Hello Rákos, thank you for the link to the documentation of the set/get keywords. On that page, you can read: "NOTE Implicit getter and setter methods are syntactic shorthand for the Object.addProperty() method found in ActionScript 1.0." So I was on the right track and it was only a syntactical AS1-to-AS2 question. ;-) You say: "AsBroadcaster is quite obsolete, why don't use the event dispatching mechanism introduced in MX 2004 (mx.events.EventDispatcher)?" I agree with eka on that, saying: "EventDispatcher isn't native in the AS1/AS2", the mx classes are just AS Code from MM, and thus is not intrinsic to the FlashPlayer in a way. AsBroadcaster is intrinsic. And I have to take a closer look on EventDispatcher, because I currently don't understand, how it can detect changes made to a property. But I'll check the other event modell classes, too. So thank you for your very good input into this direcion. Hello EKA, you live in france? Europeans seem to be a strong part of the flashcoder community. :-) I am in germany. Are there any documented comparisons between AsBroadcaster, mx.events.EventDispatcher, GDispatcher and VEGAS, yet? Thanks, Matthias _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
_______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com