Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 05-02-2008, 04:09 PM   #1
jpaper
Registered User
 
Join Date: May 2008
Posts: 2
Default 2 event listeners on one object - Error

I have an object with 2 event listeners on it.

They both work but each time one fires (with a dispatch event within the class) I get an error because it cannot convert the event to the other event. It doesn't cause any failure with the program.

This is the error:
TypeError: Error #1034: Type Coercion failed: cannot convert r_remove_event@20fc2b21 to p_remove_event.

This the p_remove_event class:

package {
import flash.events.Event;

public class p_remove_event extends flash.events.Event {
public static const REMOVE_P:String = "headControl";
public function p_remove_event(command:String ) {
super(REMOVE_P);
}
}
}

This the r_remove_event class:

package {
import flash.events.Event;

public class r_remove_event extends flash.events.Event {
public static const REMOVE_R:String = "headControl";
public function r_remove_event(command:String ) {
super(REMOVE_R);
}
}
}

Shouldn't I be able to add as many listeners to an object as I need?

Thanks
jpaper is offline   Reply With Quote
Old 05-02-2008, 04:25 PM   #2
amarghosh
unRegistered User
 
amarghosh's Avatar
 
Join Date: Feb 2008
Location: Bangalore
Posts: 817
Default

try giving different values to REMOVE_P and REMOVE_R like "headControl_P" and "headControl_R";

if that doesn't work, the problem is in handler functions. post that code
__________________
Blog
amarghosh is offline   Reply With Quote
Old 05-02-2008, 04:53 PM   #3
jpaper
Registered User
 
Join Date: May 2008
Posts: 2
Default Thats It!

Thanks so much!!

That was the Issue.
jpaper is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Event Dispatch Problem (Error #1034:) frank grimes ActionScript 3.0 14 11-19-2007 06:54 AM
Why is an event on one class object being broadcast for all instances of that class? Elz ActionScript 2.0 1 05-02-2007 04:49 PM
error with event dispatcher MrDonut ActionScript 2.0 3 05-17-2005 05:48 PM
Draw two squares and drag one mancroft ActionScript 2.0 0 02-08-2005 10:38 PM
Event handling with Listeners - learning from Java robertpenner ActionScript 1.0 (and below) 2 08-08-2001 11:36 PM


All times are GMT. The time now is 07:38 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.