[Flashcoders] AS2 EventDispatcher problem

2008-10-02 Thread Allandt Bik-Elliott (Receptacle)

hi guys - i could really use some help here

I have a swf, 'swf', that has a movieclip called 'clip' placed on  
stage that uses the following class in it's linkage


all of this is loaded into another swf with moviecliploader

[code]
import com.receptacledesign.events.EventClip

class com.Clip extends EventClip
{
public function Lex()
{
super();

trace(Lex is here);
trace(_root._currentframe);
}

public function fireEvent(evt:String):Void
{
trace(evt);
dispatchEvent({target:this, type:EventClip.FINISHED});
}
}
[/code]

The fireEvent method of Clip is called from the timeline of the clip

once the onLoadInit event fires, i'm trying to listen to it within the  
main class using the following line:


[code]
swf.clip.addEventListener(EventClip.FINISHED, Delegate.create(this,  
animationFinished));

[/code]

but the event never gets picked up (i have a trace in the  
animationFinished method to see if it's working) even tho the  
fireEvent method traces correctly (with the trace(evt));


is it possible to do what i'm trying to do or have i done something  
stupid?


thanks
allandt

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] AS2 EventDispatcher problem

2008-10-02 Thread Ian Thomas
Where's the code for EventClip? Without that, we can't be much help. :-)

Also - does trace(swf.clip) return something sensible on the timeline?
(Just so you know you're targeting the right object when using
addEventListener)

HTH,
   Ian

On Thu, Oct 2, 2008 at 11:55 AM, Allandt Bik-Elliott (Receptacle)
[EMAIL PROTECTED] wrote:
 hi guys - i could really use some help here

 I have a swf, 'swf', that has a movieclip called 'clip' placed on stage that
 uses the following class in it's linkage

 all of this is loaded into another swf with moviecliploader

 [code]
 import com.receptacledesign.events.EventClip

 class com.Clip extends EventClip
 {
public function Lex()
{
super();

trace(Lex is here);
trace(_root._currentframe);
}

public function fireEvent(evt:String):Void
{
trace(evt);
dispatchEvent({target:this, type:EventClip.FINISHED});
}
 }
 [/code]

 The fireEvent method of Clip is called from the timeline of the clip

 once the onLoadInit event fires, i'm trying to listen to it within the main
 class using the following line:

 [code]
 swf.clip.addEventListener(EventClip.FINISHED, Delegate.create(this,
 animationFinished));
 [/code]

 but the event never gets picked up (i have a trace in the animationFinished
 method to see if it's working) even tho the fireEvent method traces
 correctly (with the trace(evt));

 is it possible to do what i'm trying to do or have i done something stupid?

 thanks
 allandt

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders