Hi All,
I’m trying to fire the Event.ENTER_FRAME, on a 3DS Loader, which is objectcontainter3d, but it doesn’t fire the event at all.
Is there a workaround for that problem?
ObjectContainer3D doesn’t fire EventsSoftware: Away3D 4.x |
||
andreahmed, Member
Posted: 07 October 2013 09:53 AM Total Posts: 62 Hi All, I’m trying to fire the Event.ENTER_FRAME, on a 3DS Loader, which is objectcontainter3d, but it doesn’t fire the event at all. Is there a workaround for that problem? |
||
GoroMatsumoto, Sr. Member
Posted: 08 October 2013 07:47 AM Total Posts: 166 [ # 1 ] I ran into same. I had to addChild a displayObject to the stage. In your 3d object class:
public var eventor:Sprite = new Sprite();
In your main class:
this.addChild(3dObj.eventor);
And fire the event from the item. In your 3d object class:
eventor.dispatchEvent(new Event(Event.ENTER_FRAME));
|
||
andreahmed, Member
Posted: 08 October 2013 07:50 AM Total Posts: 62 [ # 2 ] Thanks so much. Is it ok to extend EventDispatcher? |
||
|
||
andreahmed, Member
Posted: 08 October 2013 08:09 AM Total Posts: 62 [ # 4 ] An off topic question. My 3D Object, has the X,Y reversed ( local co-ordinates). |
||
SharpEdge, Member
Posted: 08 October 2013 08:24 AM Total Posts: 94 [ # 5 ] You should extend EventDispatcher when you want to “dispatch” events, in this case you want to “listen” to events, and in particular you want to listent to a specific type of event: ENTER_FRAME. ENTER_FRAME is dispatched only by DisplayObject and all Classes that extend it, and this is not sufficent because the object should be added to the Stage! So the solution is the one proposed by Matsumoto or using a sort of controller class, similar to HoverController, that it’s not a concrete and real entity but an abstract concept and is handled by the SceneManager. If you want code logic inside the wheels you should put only the logic that controls the aspects of the wheel individually and that should not interact with the exterior. |