Packageaway3d.events
Classpublic class MouseEvent3D
InheritanceMouseEvent3D Inheritance flash.events.Event

Passed as a parameter when a 3d mouse event occurs

Public Properties
 PropertyDefined by
  ctrlKey : Boolean
Indicates whether the Control key is active (true) or inactive (false).
MouseEvent3D
  drawpri : DrawPrimitive
The draw primitive inside which the event took place.
MouseEvent3D
  element : Object
The 3d element inside which the event took place.
MouseEvent3D
  material : IUVMaterial
The material of the 3d element inside which the event took place.
MouseEvent3D
  object : Object3D
The 3d object inside which the event took place.
MouseEvent3D
  sceneX : Number
The x coordinate at which the event occurred in global scene coordinates.
MouseEvent3D
  sceneY : Number
The y coordinate at which the event occurred in global scene coordinates.
MouseEvent3D
  sceneZ : Number
The z coordinate at which the event occurred in global scene coordinates.
MouseEvent3D
  screenX : Number
The horizontal coordinate at which the event occurred in view coordinates.
MouseEvent3D
  screenY : Number
The vertical coordinate at which the event occurred in view coordinates.
MouseEvent3D
  screenZ : Number
The depth coordinate at which the event occurred in view coordinates.
MouseEvent3D
  shiftKey : Boolean
Indicates whether the Shift key is active (true) or inactive (false).
MouseEvent3D
  uv : UV
The uv coordinate inside the draw primitive where the event took place.
MouseEvent3D
  view : View3D
The view object inside which the event took place.
MouseEvent3D
Public Methods
 MethodDefined by
  
MouseEvent3D
(type:String)
Creates a new MouseEvent3D object.
MouseEvent3D
  
clone():Event
Creates a copy of the MouseEvent3D object and sets the value of each property to match that of the original.
MouseEvent3D
Public Constants
 ConstantDefined by
  MOUSE_DOWN : String = "mouseDown3d"
[static] Defines the value of the type property of a mouseDown3d event object.
MouseEvent3D
  MOUSE_MOVE : String = "mouseMove3d"
[static] Defines the value of the type property of a mouseMove3d event object.
MouseEvent3D
  MOUSE_OUT : String = "mouseOut3d"
[static] Defines the value of the type property of a mouseOut3d event object.
MouseEvent3D
  MOUSE_OVER : String = "mouseOver3d"
[static] Defines the value of the type property of a mouseOver3d event object.
MouseEvent3D
  MOUSE_UP : String = "mouseUp3d"
[static] Defines the value of the type property of a mouseUp3d event object.
MouseEvent3D
  ROLL_OUT : String = "rollOut3d"
[static] Defines the value of the type property of a rollOut3d event object.
MouseEvent3D
  ROLL_OVER : String = "rollOver3d"
[static] Defines the value of the type property of a rollOver3d event object.
MouseEvent3D
Property detail
ctrlKeyproperty
public var ctrlKey:Boolean

Indicates whether the Control key is active (true) or inactive (false).

drawpriproperty 
public var drawpri:DrawPrimitive

The draw primitive inside which the event took place.

elementproperty 
public var element:Object

The 3d element inside which the event took place.

materialproperty 
public var material:IUVMaterial

The material of the 3d element inside which the event took place.

objectproperty 
public var object:Object3D

The 3d object inside which the event took place.

sceneXproperty 
public var sceneX:Number

The x coordinate at which the event occurred in global scene coordinates.

sceneYproperty 
public var sceneY:Number

The y coordinate at which the event occurred in global scene coordinates.

sceneZproperty 
public var sceneZ:Number

The z coordinate at which the event occurred in global scene coordinates.

screenXproperty 
public var screenX:Number

The horizontal coordinate at which the event occurred in view coordinates.

screenYproperty 
public var screenY:Number

The vertical coordinate at which the event occurred in view coordinates.

screenZproperty 
public var screenZ:Number

The depth coordinate at which the event occurred in view coordinates.

shiftKeyproperty 
public var shiftKey:Boolean

Indicates whether the Shift key is active (true) or inactive (false).

uvproperty 
public var uv:UV

The uv coordinate inside the draw primitive where the event took place.

viewproperty 
public var view:View3D

The view object inside which the event took place.

Constructor detail
MouseEvent3D()constructor
public function MouseEvent3D(type:String)
Parameters
type:String — The type of the event. Possible values are: MouseEvent3D.MOUSE_OVER, MouseEvent3D.MOUSE_OUT, MouseEvent3D.MOUSE_UP, MouseEvent3D.MOUSE_DOWN and MouseEvent3D.MOUSE_MOVE.
Method detail
clone()method
public override function clone():Event

Creates a copy of the MouseEvent3D object and sets the value of each property to match that of the original.

Returns
Event
Constant detail
MOUSE_DOWNconstant
public static const MOUSE_DOWN:String = "mouseDown3d"

Defines the value of the type property of a mouseDown3d event object.

MOUSE_MOVEconstant 
public static const MOUSE_MOVE:String = "mouseMove3d"

Defines the value of the type property of a mouseMove3d event object.

MOUSE_OUTconstant 
public static const MOUSE_OUT:String = "mouseOut3d"

Defines the value of the type property of a mouseOut3d event object.

MOUSE_OVERconstant 
public static const MOUSE_OVER:String = "mouseOver3d"

Defines the value of the type property of a mouseOver3d event object.

MOUSE_UPconstant 
public static const MOUSE_UP:String = "mouseUp3d"

Defines the value of the type property of a mouseUp3d event object.

ROLL_OUTconstant 
public static const ROLL_OUT:String = "rollOut3d"

Defines the value of the type property of a rollOut3d event object.

ROLL_OVERconstant 
public static const ROLL_OVER:String = "rollOver3d"

Defines the value of the type property of a rollOver3d event object.

Wiki link
Click to go to the wiki page for 'away3d.events.MouseEvent3D'

Code examples

Dynamic Mouse Objects  based on V1.9.4 

view.mouseZeroMove=true;

myObject.name='away3D_name';
myObject.addOnMouseOver(mymouseFunction);
 
function mymouseFunction(event:MouseEvent3D):void {
     var temp=event.object;
     trace(temp.name);
}

*Lesson_Basic_05_MouseEvents.fla  based on V1.9.2 

// import core library
import away3d.core.scene.*;
// import geometry primitives
import away3d.objects.*;
// import materials
import away3d.core.material.*;
// import mesh type
import away3d.core.mesh.*;

// create a 3D-viewport
var view:View3D = new View3D({x:300, y:200});
// add viewport to the stage
addChild(view);

// create carousel
var plane:Mesh = new RegularPolygon({material:"grey#", radius:500, y:-100, pushback:true});
var sphere1:Mesh = new Sphere({material:"blue#", radius:100, x:350});
var sphere2:Mesh = new Sphere({material:"cyan#", radius:100, x:-350});
var sphere3:Mesh = new Sphere({material:"green#", radius:100, z:350});
var sphere4:Mesh = new Sphere({material:"lime#", radius:100, z:-350});
var carousel:Object3D = new ObjectContainer3D(sphere1, sphere2, sphere3, sphere4, plane);

// add carousel to the scene
view.scene.addChild(carousel);

// register mouse event handler
carousel.addOnMouseDown(onCarouselMouseDown);
function onCarouselMouseDown(event:MouseEvent3D):void {
	// set the clicked mesh a new material
    (event.object as Mesh).material = new WireColorMaterial("random");
}

// every frame
addEventListener(Event.ENTER_FRAME, onEnterFrame);
function onEnterFrame(event:Event):void {
	// rotate carousel
    carousel.rotationY = getTimer() / 100;
	// rerender viewport
	view.render();
}

From Lesson_Basic_05_MouseEvents.fla


Comments
No comments found
Please leave a comment

Please leave a comment

security image