Possible missing import statement?

Software: Away3D 4.x

Alex Bell, Newbie
Posted: 21 May 2014 11:46 AM   Total Posts: 1

I am trying to create a click and drag function for the camera for skybox but I am having an issue with undefined properties not being accessed, I believe I am missing an import statement but I cannot remember what it was that I needed.

Errors that I am having,

Access of undefined property mouseUpHandler.
Access of undefined property mouseDownHandler
Access of undefined property onResize
Call to a possibly undefined method onResize.

import away3d.cameras.lenses.*;
 
import away3d.cameras.Camera3D;
 
import away3d.containers.*;
 
import away3d.entities.*;
 
import away3d.materials.*;
 
import away3d.materials.methods.*;
 
import away3d.primitives.*;
 
import away3d.textures.*;
 
import away3d.utils.*;
 
import away3d.containers.View3D;
 
import away3d.controllers.HoverController;

 
 
import flash.display.*;
 
import flash.events.*;
 
import flash.geom.Vector3D;
 
 
import flash.events.KeyboardEvent;
 
import flash.events.MouseEvent;
 
import flash.events.Event;
 
import flash.ui.Keyboard;

function 
initListeners():void{
   addEventListener
(Event.ENTER_FRAMEonEnterFrame);
   
view.addEventListener(MouseEvent.MOUSE_UPmouseUpHandler);
   
view.addEventListener(MouseEvent.MOUSE_UPmouseDownHandler);
   
stage.addEventListener(Event.RESIZEonResize);
   
   
onResize()
   
   
cameraController = new HoverController(cameranull45305205);


  
}
  
  
private function onEnterFrame(event:Event):void
  {
   
if (move){
    cameraController
.panAngle 0.3*(stage.mouseX lastMouseX) + lastPanAngle;
    
cameraController.tiltAngle 0.3*(stage.mouseY lastMouseY) + lastTiltAngle;
  
}
  
  
function mouseDownHandler(event:MouseEvent):void{
   move 
true;
   
lastPanAngle cameraController.panAngle;
   
lastTiltAngle cameraController.tiltAngle;
   
lastMouseX stage.mouseX;
   
lastMouseY stage.mouseY;
   
stage.addEventListener(Event.MOUSE_LEAVEonStageMouseLeave);
   
  
}
  
   
function mouseUpHandler(event:MouseEvent):void{
   
   move 
false;
   
stage.removeEventListener(Event.MOUSE_LEAVEonStageMouseLeave);
  
}
  
  
function onStageMouseLeave(event:Event):void
  {
   move 
false;
   
stage.removeEventListener(Event.MOUSE_LEAVEonStageMouseLeave);
  
}
  
  
function onResize (event:Event null):void
  {
   view
.width  stage.stageWidth;
   
view.height stage.stageHeight;
   
//awayStats.x = stage.stageWidth - awayStats.width;
  
   

Avatar
mrpinc, Sr. Member
Posted: 21 May 2014 01:10 PM   Total Posts: 119   [ # 1 ]

You need to provide a scope for all those function deffinitions.

so either

private function mouseUpHandler(event:MouseEvent):void{

or

public function mouseUpHandler(event:MouseEvent):void{

 

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X