Hello,
I learned a lot now about broadcasting events, but still haven't
achieve my initial intention, which was as follows:
I want to have a class (kind of black-box), I call MyUIObject.
Then I want to create instances of MyUIObject:
var uio:MyUIObject = new MyUIObject();
I want to have a
The set/get (former addProperty) methodology seemed to offer the
solution, but now I see, that I can implicit (not writing
uio.setSomething, but uio._something) set a value, but _something is
private and thus code completion etc. will not work.
Matthias
Hello :)
the _ notation is used to do the difference between private and public ...
if you create a virtual property with get/set used in private the _ notation
:
class Test
{
function Test()
{
}
/**
* Internal private value.
*/
private var _value:Number ;
public
Hello,
I often need to recognize for some of my gui elemets when the embedded
gui elements (childs) have changed or vice-versa the parent elements
has changed in a property, like _x, _width, etc. to repaint the
necessary elements of the GUI.
So what is the best way to do this?
I stumbled over
Hello :)
1 - Object watch failed with virtual properties (_x, _y, _width etc)..
don't use addProperty and watch method !!
In your example you must return the new value in the change method !!!
var o:Object = {} ;
o.prop = 0 ;
var change = function ( id , oldValue, newValue)
{
trace(id
Hello EKA,
thanks for your reply.
to your 1: yes, i really don't wanted to use watch. the watch method
is less performant, I have read on this list sometime before. That's,
why I asked my question. It admit, it has been more than only one
question. :-)
to your 2: I usually give my constructor
Hello :)
you can but a good event model use AsBroadcaster or other system to dispatch
the events :) In my personnal AS2 OpenSource framework i use a event model
compatible with W3C Dom3 event model for example (like AS3 framework)
it's more easy to use a event model to dispatch information
Hello eka,
perhaps I can cotton up with (btw. is this good english?)
AsBroadcaster, since it is availablefrom flash version 6 and above.
:-)
But I can't find documentations about the set/get syntax you used. But
it works just perfect. And I guess this set and get keywords are
available within
MD perhaps I can cotton up with (btw. is this good english?)
MD AsBroadcaster, since it is availablefrom flash version 6 and above.
AsBroadcaster is quite obsolete, why don't use the event dispatching
mechanism introduced in MX 2004 (mx.events.EventDispatcher)? It
handles separate callbacks (see
hello :)
sorry for my english ... i speak french and the english is difficult for me
:(
if you want try my openSource framework read this page :
http://vegas.riaforge.org/
1 - Download with a SVN client the subversion of the project or download the
zip in the project page( SVN is better to use
Hello :)
EventDispatcher isn't native in the AS1/AS2 framework, AsBroadcaster is a
speed solution to implement an event model in your code.
The EventDispatcher in AS3 is compatible with the W3C DOM3 event model with
a custom implementation of all listeners...
For me in AS2 you can
1 - use
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
MD So I was on the right track and it was only a syntactical AS1-to-AS2
MD question. ;-)
Well, actually the whole AS2 syntax is a shorthand for AS1 syntax :)
In fact the AS2 compiler is a preprocessor only, which creates AS1
source from the AS2 one and this AS1 source will be compiled to
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
14 matches
Mail list logo