Classes Must Not Be Nested

Software: Away3D 4.x

frogman_pep, Newbie
Posted: 25 August 2012 02:27 AM   Total Posts: 19

Not sure if this is an Away3D error?

Created an ActionScript Mobile project in Flash Builder 4.6.  Followed the steps to overlay AIR 3.4 SDK in a project with the code as follows:

package{
 import away3d
.cameras.Camera3D;
 
import away3d.containers.Scene3D;
 
import away3d.containers.View3D;
 
import away3d.controllers.HoverController;
 
import away3d.loaders.Loader3D;
 
import away3d.loaders.parsers.Parsers;
 
 
import flash.display.Sprite;
 
import flash.display.StageAlign;
 
import flash.display.StageScaleMode;
 
import flash.events.Event;
 
import flash.events.MouseEvent;
 
import flash.geom.Vector3D;
 
import flash.net.URLRequest;
 
 
[SWF(backgroundColor="#000000"frameRate="60")]
 
 
public class Gyro7 extends Sprite {
  
  
  
private var _view:View3D;
  private var 
_scene:Scene3D;
  private var 
_camera:Camera3D;
  private var 
_loader:Loader3D;
  private var 
hoverController:HoverController;
  private var 
_prevMouseX:Number;
  private var 
_prevMouseY:Number;
  private var 
_angleX:Number 0;
  private var 
_angleY:Number 0;
  private var 
_angleZ:Number 0;
  
  public function 
Gyro7(){
   
   Parsers
.enableAllBundled();   
   
setup3d();
  
}
  
  
private function setup3d():void{
   
   stage
.scaleMode StageScaleMode.EXACT_FIT;   
   
   
_view addChild(new View3D()) as View3D;
   
_view.antiAlias 4;
   
   
_view.width 400;
   
_view.height 300;
   
_scene _view.scene;
   
_camera _view.camera;
   
_camera.lens.far 5000;
   
_camera.lens.near 20;
   
   
hoverController = new HoverController(_camera);
   
hoverController.tiltAngle 0;
   
hoverController.panAngle 180;
   
hoverController.minTiltAngle = -60;
   
hoverController.maxTiltAngle 60;
   
   
stage.addEventListener(MouseEvent.MOUSE_DOWNonStageMouseDown);
   
stage.addEventListener(MouseEvent.MOUSE_MOVEonStageMouseMove);
   
stage.addEventListener(MouseEvent.MOUSE_WHEELonStageMouseWheel);
   
   
_loader = new Loader3D(truenull);
   
_loader.load( new URLRequest("model/Character.AWD"));
   
_loader.scaleX _loader.scaleY _loader.scaleZ 10;
   
_loader.= -250;
   
_loader.100;
   
_scene.addChild_loader );
   
   
addEventListenerEvent.ENTER_FRAMErender );
  
}  
  
  
private function onStageMouseDown(event:MouseEvent):void{
   
   _prevMouseX 
event.stageX;
   
_prevMouseY event.stageY;
  
}
  
  
private function onStageMouseMove(ev:MouseEvent):void{
   
   
if (ev.buttonDown{
    hoverController
.panAngle += (ev.stageX _prevMouseX);
    
hoverController.tiltAngle += (ev.stageY _prevMouseY);
   
}
   
   _prevMouseX 
ev.stageX;
   
_prevMouseY ev.stageY;
  
}
  
  
private function onStageMouseWheel(ev:MouseEvent):void{
   
   hoverController
.distance -= ev.delta 5;
   
   if (
hoverController.distance 100){
    hoverController
.distance 100;
   
}
   
else if (hoverController.distance 2000){
    hoverController
.distance 2000;
   
}
  }
  
  
  
  
  
private function rendere:Event ):void{
   
   _camera
.lookAt(new Vector3D());
   
_view.render();
  
}
 } 

I’ve been able to run this project successfully on my phone, but after closing out the app and making changes an ‘An internal build error has occurred. See the log for more information” error pops up and then if I do a Project Clean, the Error: 1131: Classes must not be nested comes up at line: “public class Gyro7 extends Sprite {”.

Next Post has Error Log

 

   

frogman_pep, Newbie
Posted: 25 August 2012 02:29 AM   Total Posts: 19   [ # 1 ]
!ENTRY com.adobe.flexbuilder.project 4 43 2012-08-24 22:17:38.783
!MESSAGE Uncaught exception in compiler
!STACK 0
java
.lang.NullPointerException
 at macromedia
.asc.semantics.ConfigurationEvaluator.evaluate(ConfigurationEvaluator.java:228)
 
at macromedia.asc.semantics.ConfigurationEvaluator.evaluate(ConfigurationEvaluator.java:1177)
 
at macromedia.asc.parser.MetaDataNode.evaluate(MetaDataNode.java:39)
 
at macromedia.asc.semantics.ConfigurationEvaluator.evalAndFold(ConfigurationEvaluator.java:979)
 
at macromedia.asc.semantics.ConfigurationEvaluator.evaluate(ConfigurationEvaluator.java:904)
 
at macromedia.asc.parser.StatementListNode.evaluate(StatementListNode.java:60)
 
at macromedia.asc.semantics.ConfigurationEvaluator.evaluate(ConfigurationEvaluator.java:1447)
 
at macromedia.asc.parser.ProgramNode.evaluate(ProgramNode.java:80)
 
at flex2.compiler.as3.As3Compiler.parse1(As3Compiler.java:369)
 
at flex2.compiler.CompilerAPI.parse1(CompilerAPI.java:2872)
 
at flex2.compiler.CompilerAPI.parse1(CompilerAPI.java:2825)
 
at flex2.compiler.CompilerAPI.batch2(CompilerAPI.java:457)
 
at flex2.compiler.CompilerAPI.batch(CompilerAPI.java:1291)
 
at flex2.compiler.CompilerAPI.compile(CompilerAPI.java:1522)
 
at flex2.tools.oem.Application.compile(Application.java:1349)
 
at flex2.tools.oem.Application.recompile(Application.java:1287)
 
at flex2.tools.oem.Application.compile(Application.java:886)
 
at flex2.tools.flexbuilder.BuilderApplication.compile(BuilderApplication.java:359)
 
at com.adobe.flexbuilder.multisdk.compiler.internal.ASApplicationBuilder$MyBuilder.mybuild(ASApplicationBuilder.java:319)
 
at com.adobe.flexbuilder.multisdk.compiler.internal.ASApplicationBuilder.build(ASApplicationBuilder.java:129)
 
at com.adobe.flexbuilder.multisdk.compiler.internal.ASBuilder.build(ASBuilder.java:198)
 
at com.adobe.flexbuilder.multisdk.compiler.internal.ASItemBuilder.build(ASItemBuilder.java:70)
 
at com.adobe.flexbuilder.project.compiler.internal.FlexProjectBuilder.buildItem(FlexProjectBuilder.java:607)
 
at com.adobe.flexbuilder.project.compiler.internal.FlexProjectBuilder.build(FlexProjectBuilder.java:382)
 
at com.adobe.flexbuilder.project.compiler.internal.FlexIncrementalBuilder.build(FlexIncrementalBuilder.java:187)
 
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
 
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
 
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
 
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
 
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
 
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
 
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
 
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
 
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
 
at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:513)
 
at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:432)
 
at org.eclipse.ui.actions.BuildAction$1.runInWorkspace(BuildAction.java:305)
 
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
 
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54
   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X