Can you give an example of the memory leak you are talking about and
also an example of the arguments.caller remove listener? I have not
heard of this before.
Is the memory leak issue caused when you nest a function inside a class?
class myClass {
function myClass() {
This may be a duh question, but when you use dispatchEvent in a custom
created component, can I use my own event name or do i have to use one of
the built in ones of an object. For example, I am creating custom quiz
component (the built in ones dont have the flexibility we need) and would
like to
yeah. the type property can be whatever, as long as you know what you are
listening for all is good.
On 2/17/06, Jamie Alpers [EMAIL PROTECTED] wrote:
This may be a duh question, but when you use dispatchEvent in a custom
created component, can I use my own event name or do i have to use one
If you are using Flex2 , create a custom event that extends from the
event class. and inject the namespace for the custom event into the
superclass.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
Thanks. I relooked at my code and realized i was just making a stupid
mistake by confusing object names. it works now :-)
On 2/17/06, Johannes Nel [EMAIL PROTECTED] wrote:
yeah. the type property can be whatever, as long as you know what you are
listening for all is good.
On 2/17/06, Jamie
Just make sure int he constructor you initialize it::
EventDispatcher.initialize(this)..
also you ned to have these var definititions:
public var addEventListener:Function
public var removeEventListener:Function;
private var dispatchEvent:Function
then to dispatch:
dispatchEvent( {
Must resist...the crack...habbit...
and if you want to point that dispatched to a custom method not named
the same as the event:
obj.addEventListener(onWhatever, Delegate.create(this, myCustomMethod));
private function myCustomMethod(evtObj:Object):Void
{
// code
}
Also, you don't need
what john is outlining here is fine in essence, but unless you never want to
remove this event listener this will cause a memory leak. either you create
the delegate function on a class scope or you use arguments.caller in the
handler function to remove the event listener
On 2/17/06, John Grden
I thought I better post this incase someone else is having similar issues,
awhile ago I made a post that flash 8 was crashing on FLV events in Flash 8.
Finally I tracked it down, its not the media crashing it, its event
dispatcher, I'm listening for the same event in my super class, like this...
9 matches
Mail list logo