I'm trying to figure out how the object that you are adding this
attribute to knows to talk to the attribute? If you are adding the
attribute from some other place, how will the attribute ever be
modified? Doesn't the object you are adding this attribute to need to
know about it?
On 2009-10-04, at 21:04, James Robey wrote:
A little more:
i want this because then i can use <handler name="onmyevent"
reference="parent"> without the SWF9 stricter constraint system
crashing on me. the attribute would not exist at the time the
handler was evaluated so it would fail (fine) but new objects made
in the system could see it, and that would lead to being able to
write code that uses handler tags.
My guess is i'm seeing just a small issue in the constraint system
that will get sorted out soon.
P T Withington wrote:
You can do this in on operation:
new lz.Delegate(this, 'something', that, 'eventname');
you'll want to hang on to a reference to the new delegate, so you
can unregister it in your destroy method, otherwise it causes a leak.
We hope to fix this some day:
http://jira.openlaszlo.org/jira/browse/LPP-225
Also, we have some ideas about how to dynamically add handlers, so
that you don't have to understand the delegate mechanism to do what
you want. (Hm. can't find the Jira for tha just now...)
On 2009-10-04, at 16:58, James Robey wrote:
Poor form, sorry, but i answered my own question. I didn't need
to do make another attribute. i found another way around the
problem using these two lines which are a common pattern:
var something_method = new lz.Delegate(this, "something");
something_method.register(parent.after, "onmyevent");
That worked just fine for my needs once i realized it was all i
needed. Thanks for reading it!
.james.
and