feisishui / papervision3d

Automatically exported from code.google.com/p/papervision3d
0 stars 0 forks source link

(fix provided in issue) InteractiveScene3DEvent dosent have clone method wich produce crash when redispatching event #268

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
create a class that extends org.papervision3d.objects.primitives.Cube (for
exemple cubeButton3D extends Cube) 
2.
in cubeButton3D add an event listener on OBJECT_DOUBLE_CLICK like that:
addEventListener(InteractiveScene3DEvent.OBJECT_DOUBLE_CLICK,
onMouseDoubleClick);

3. create an other class that encapsulate cubeButton3D for exemple
that listen to the interactiveScene3DEvent and redispatch it 
class button3DController extends EventDispatcher
{
  private var m_cubebutton3D: cubeButton3D: null
  private function foo():void
  {
    cubebutton3D.addEventListener
    (
      InteractiveScene3DEvent.OBJECT_DOUBLE_CLICK, 
      onMouseDoubleClick
    );
  }
  private function foo(event:InteractiveScene3DEvent):void
  {
    //redispatch the event
    dispatch(event);
  }
}

What is the expected output? What do you see instead?
  I expected to redispatch the InteractiveScene3DEvent, but the application
crash and the debugger claims a conversion error it can convert an event to
an interactiveScene3DEvent

What version of the product are you using? On what operating system?
rev 942

Please provide any additional information below.

The crash is quite normal, because the flash dispatch system try to clone
the event so it call the Event.clone(...) method because there is no clone
method in InteractiveScene3DEvent. I have written a clone method in
InteractiveScene3DEvent wich fix the trouble. You will find fix in
attachment, fill free to use it or not.

Original issue reported on code.google.com by damien.miras on 18 May 2010 at 10:41

Attachments: