Events
INITIALIZATION_FINISHED
- dispatched when all necessary to play Esquimo SWF data are transfered to graphics card and the internal engine is initialised.
It is useful when you want to make sure that loaded Esquimo movie clip will start with other display objects at the same time. Stage3D content and Esquimo initialisation process may take short but noticable time.
(...) m_esquimo.addEventListener(NEsquimo3D.INITIALIZATION_FINISHED, esquimoInitialised); (...) private function esquimoInitialised(e:Event):void{ displayRemainingContent(); // Esquimo initialisation process has been finished, you can carry on with displaying other elements. }
MOUSE_CLICK
- dispatched when the user clicks on any of geometry objects displayed by SWF created in Esquimo.
(...) m_esquimo.addEventListener(NEsquimo3D.MOUSE_CLICK, mouseClickHandler); (...) private function mouseClickHandler(e:MouseEvent):void{ var whichone:int = e.delta; // A geometry object whose ID = whichone has been clicked. }
The delta value has been used to retrieve the object ID which the event concerns.
MOUSE_OVER / MOUSE_OUT
- dispatched when the user moves a mouse cursor over/leaves the object of animation created in Esquimo.
(...) m_esquimo.addEventListener(NEsquimo3D.MOUSE_OVER, m_esquimo_mouseOver); m_esquimo.addEventListener(NEsquimo3D.MOUSE_OUT, m_esquimo_mouseOut); (...) private function m_esquimo_mouseOver(e:MouseEvent):void{ var whichone:int = e.delta; // A mouse cursor is over geometry object whose ID = whichone } private function m_esquimo_mouseOut(e:MouseEvent):void{ var whichone:int = e.delta; // A mouse cursor moved out of the geometry object whose ID = whichone }
Important: In order to use MOUSE_OVER / MOUSE_OUT events at least 1 object must have Events/Mouse over event detection activated in Esquimo editor.
FRAME_RENDERED
- dispatched every time the single frame of SWF created in Esquimo is rendered.
private var sphere_1:uint; private var sphere_2:uint; var pos:Number; (...) sphere_1 = m_esquimo.GeometryCreateSphere(Esq_scene_el.SURFACE_1, 1, 50, 1); sphere_2 = m_esquimo.GeometryCreateSphere(Esq_scene_el.SURFACE_2, 2, 50, 1); pos = -4; m_esquimo.SetGeometryPosition(sphere_2, pos, 0 , 0); m_esquimo.addEventListener(NEsquimo3D.FRAME_RENDERED, m_esquimo_frameRendered); (...) private function m_esquimo_frameRendered(e:Event):void { m_esquimo.SetGeometryPosition(sphere_2, pos += 0.05, 0 , 0); }