weird error with adobe air

Software: Away3D 4.x

milton, Newbie
Posted: 14 December 2011 04:15 AM   Total Posts: 7

i have a simple project, a ball rotating to be compiled from flash ide using air 3.1 engine…in my mac computer it works fine but my project should be compiled in a pc because i have to integrated with other resources…
on the pc i receive an error: Error #2044: Unhandled ErrorEvent:. text=Error #3702: Context3D not available….it export the swf and it works fine in fp11 but nothing in air…
here is my code:

import away3d.containers.View3D;
 
import away3d.events.LoaderEvent;
 
import away3d.loaders.Loader3D;
 
import away3d.loaders.parsers.Parsers;
 
import away3d.loaders.parsers.data.DefaultBitmapData;
 
import away3d.materials.BitmapFileMaterial;
 
import away3d.materials.ColorMaterial;
 
import away3d.primitives.Sphere;
 
import away3d.tools.MeshHelper;
 
import flash.display.Loader;
 
import flash.display.Sprite;
 
import flash.events.Event;
 
import flash.net.URLRequest;
 
import flash.display.StageAlign;
 
import flash.display.StageScaleMode;
 
import flash.display3D.textures.Texture
 
 [SWF
(width="1280"height="1024")]
 
  
var _view View3D;
  var 
_loader Loader3D;
  var 
mundo Sphere;
  var 
miMaterial ColorMaterial;
  var 
mapamundi BitmapFileMaterial;
  
  
   
stage.align StageAlign.TOP_LEFT;
   
stage.scaleMode StageScaleMode.NO_SCALE;
   
   
_view = new View3D();
   
_view.backgroundColor 0x666666;
   
_view.antiAlias 4;
   
   
this.addChild(_view);
   
this.addEventListener(Event.ENTER_FRAMEonEnterFrame);
   
   
Parsers.enableAllBundled();
   
_loader = new Loader3D();
   
_loader.addEventListener(LoaderEvent.RESOURCE_COMPLETEonResourceComplete);
   
_loader.addEventListener(LoaderEvent.LOAD_ERRORonLoadError);
   
_loader.load( new URLRequest('hotel/cosa.obj') );
   

   
miMaterial = new ColorMaterial(0);
   
mapamundi = new BitmapFileMaterial('hotel/mapa.jpg');
   
mundo = new Sphere(mapamundi3206060);
   
MeshHelper.invertFaces(mundo);
   
  
  
  
   function 
onResourceComplete(ev LoaderEvent) : void
  {
   _loader
.removeEventListener(LoaderEvent.RESOURCE_COMPLETEonResourceComplete);
   
_loader.removeEventListener(LoaderEvent.LOAD_ERRORonLoadError);
   
_view.scene.addChild(mundo);
  
}
  
  
   
function onLoadError(ev LoaderEvent) : void
  {
   trace
('Could not find'ev.url);
   
_loader.removeEventListener(LoaderEvent.RESOURCE_COMPLETEonResourceComplete);
   
_loader.removeEventListener(LoaderEvent.LOAD_ERRORonLoadError);
   
_loader null;
  
}
  
  
   
function onEnterFrame(ev Event) : void
  {

   mundo
.rotationY ++;
   
mundo.scaleY 1.2;
   
mundo.35;
   
_view.render();
  

when i run a test it says is compiling with air3.1 so that’s not the trouble:

import flash.display.Stage3D;
import flash.desktop.NativeApplication;
import flash.text.TextField;
 
function 
air3_test(){
    
var stage3d = new Stage3D();
    var 
my_fmt:TextFormat = new TextFormat();
    
my_fmt.color 0xFF0000;
    
my_fmt.size 32;
    
my_fmt.bold true;
    
my_fmt.font  "Arial";
    var 
textFTextField = new TextField;
    
textF.defaultTextFormat my_fmt;
    
textF.autoSize TextFieldAutoSize.LEFT;
    
textF.text "Hello AIR Version No. " NativeApplication.nativeApplication.runtimeVersion +"\n" stage3d;
    
addChild(textF);
    
trace "+ Flash CS5.5.air3_test() - args: " [stage3d,"AIR Version: " NativeApplication.nativeApplication.runtimeVersion ] );
}
 
air3_test
(); 


any idea on solving this?

   

John Brookes, Moderator
Posted: 14 December 2011 04:30 PM   Total Posts: 732   [ # 1 ]

In apllication.xml
<renderMode>direct</renderMode>

maybe

   

milton, Newbie
Posted: 14 December 2011 05:05 PM   Total Posts: 7   [ # 2 ]

did it and still does not work, i checked in my mac and actually does not work either, the same error…looks nobody knows this error

   

Avatar
mrpinc, Sr. Member
Posted: 14 December 2011 05:56 PM   Total Posts: 119   [ # 3 ]

make sure you add the additional compiler argument -swf-version=13

   

milton, Newbie
Posted: 14 December 2011 06:21 PM   Total Posts: 7   [ # 4 ]

sorry my ignorance…how to do that in flash cs5?

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X