Away3D not working w/ Flash Builder & SDK 4.5.1 - Desperate

Software: Away3D 4.x

Agilis, Newbie
Posted: 01 August 2011 09:47 PM   Total Posts: 18

Hello,

I am trying to get Away3D to work with Flash Builder 4.0 (build 272416) using Flex SDK 4.5.1 and currently, when I launch a Desktop project (Air), the launch fails immediately. Here is some background:

Using the Away3D source from here:
http://away3d.googlecode.com/svn/trunk/broomstick/Away3D

Installed
Flex SDK 4.5.1

Replaced the playerglobal.swc in frameworks/libs/player/10.2 with the updated version from here:

Installed both the 32bit and 64bit versions of the Flash Player 11 installs for both Active-x for IE Only and for all other browsers.

Installed the 32bit versions of the Flash Player 11 debugger

Configured my Flex Project’s compiler to use

-swf-version=13 

Configured the Flex project so that it would reference the Away3D Flex Library Project I wrapped my Away3D source in.

Using the following ActionScript within a <fx:Script > script block within my main app’s MXML:
The code below results in no errors but will not run due to a configuration error within my environment

import away3d.containers.View3D;
import away3d.primitives.Cube;
   
import flash.display.Sprite;
import flash.events.Event;
   
import mx.events.FlexEvent;
   
// Private Variables
private var _view:View3D;

protected function 
windowedapplication1_creationCompleteHandler(event:FlexEvent):void
{
 _view 
= new View3D();
 
_view.275;
 
_view.200;
    
 
this.addChild(_view);
 
this.addEventListener(Event.ENTER_FRAMEonEnterFrame);
    
 var 
cube:Cube = new Cube(); 
 
_view.scene.addChild(cube); 
}

private function onEnterFrame(event:Event):void
{
 _view
.render();

I have done all the steps above and when I try to run my project, the project immediately fails with the following message:

Process terminated without establishing connection to debugger. error while loading initial content

If I change the SDK to 4.0 (AIR2) & remove the swf-version declarative, then I am left with 70 some errors with many classes/references not being found.

Now, not being able to get Away3D working with Flex SDK 4.5.1, I decided to try to get Away3DLite to work by first, making sure I was using Flex SDK 4.0 and creating a Flex Library Project for Away3DLite source. It WORKED!

So Away3DLite worked, Away3D does not. The problem is, the book I’m learning 3D in Flash in requires Away3D :(

I appreciate any support or suggestions you might have and thanks for your time.

- Rick

   

Stephen Hopkins, Sr. Member
Posted: 02 August 2011 12:16 AM   Total Posts: 110   [ # 1 ]

Try changing the minimum version to 11.0, and putting your playerglobal.swc in there, there,  frameworks/libs/player/11.0. Thats how my projects are setup. Also, don’t install both flash players. I would uninstall both, and just install the 32 bit player/debugger

 Signature 

http://www-scf.usc.edu/~shopkins

   

zanuka, Newbie
Posted: 02 August 2011 04:20 AM   Total Posts: 2   [ # 2 ]

Rick, did you get this going??? I’m having the same problem… been trying this method by John Lindquist http://johnlindquist.com/2011/02/28/quickstart-for-molehill-and-away3d/

but seems outdated now…

keen to see a solid workflow tutorial/example for 4.5.1 + molehill + away3d 4 in action

anyone?

   

Richard Olsson, Administrator
Posted: 02 August 2011 07:08 AM   Total Posts: 1192   [ # 3 ]

Are you using AIR? Are you aware that you need to use AIR 3.0 for Molehill to work? Have you set it up per the instructions on Adobe Labs?

   

Avatar
Alexander Seifert, Moderator
Posted: 02 August 2011 09:05 AM   Total Posts: 129   [ # 4 ]

Agilis,

do you intentionally use outdated Away3D Broomstick code from Google Code’s SVN along with the an outdated version of playerglobal.swc?

From what I understand, you use the most current, official Flash 11 Beta Player, which was released a couple of weeks ago.
However, the playerglobal.swc that you linked dates back to the very first Incubator release end of February.

I recommend using latest Away3D code from github:
https://github.com/away3d/away3d-core-fp11

and latest playerglobal.swc for Flash 11 Beta along with the Flash Players from the very same page here:
http://labs.adobe.com/downloads/flashplayer11.html

Cheers,
Alex

 Signature 
signature_image

http://www.deltastrike.org

   

Agilis, Newbie
Posted: 02 August 2011 01:58 PM   Total Posts: 18   [ # 5 ]

Hello everyone,

Thank you for your suggestions and replies.

Zanuka, I’m going to try to get this working again today using the help received so far from the replies here. I will keep you posted.

Richard, I was unaware that I needed Adobe Air 3.0 and regarding the instructions you are referencing, do you happen to have a link to these instructions from Adobe Labs?

Alex, no I did not intentionally use outdated code. I’ve been trying to put together bits & pieces related to trying to get Away3D Broomstick working with Flash Builder.

I will try what has been recommended here and reply when I have some sort of status update.

Thanks again.

   

Agilis, Newbie
Posted: 02 August 2011 03:02 PM   Total Posts: 18   [ # 6 ]

Okay,

There seems to be a lot of misinformation when it comes to implementing Away3D as well as *old* or outdated help.

Now I have revised my steps to the following:

Using the Away3D source from here:

Installed
Flex SDK 4.5.1

Replaced the playerglobal.swc in frameworks/libs/player/10.2 with the updated version found here

Installed both the 32bit and 64bit versions of the Flash Player 11 installs for both Active-x for IE Only and for all other browsers.

Installed the 32bit versions of the Flash Player 11 debugger

Configured my Flex Project’s compiler to use

-swf-version=13 

Created a new Flex Web project so that it would reference the Away3D Flex Library Project I wrapped my Away3D Github source in.

Using the following ActionScript within a <fx:Script > script block within my main app’s MXML:
The code below results in no errors but will not run due to a configuration error within my environment

import away3d.containers.View3D;
import away3d.primitives.Cube;
   
import flash.display.Sprite;
import flash.events.Event;
   
import mx.events.FlexEvent;
   
// Private Variables
private var _view:View3D;

protected function 
windowedapplication1_creationCompleteHandler(event:FlexEvent):void
{
 _view 
= new View3D();
 
_view.275;
 
_view.200;
    
 
this.addChild(_view);
 
this.addEventListener(Event.ENTER_FRAMEonEnterFrame);
    
 var 
cube:Cube = new Cube(); 
 
_view.scene.addChild(cube); 
}

private function onEnterFrame(event:Event):void
{
 _view
.render();

Now, everything compiles, but when it runs, I receive a run-time error:

addChild() is not available in this class. Instead, use addElement() or modify the skin, if you have one.

When I change it to addElement, I receive compile-time error dealing with a coercion issue. Doing some research, I try to implement the following tutorial which wraps the Away3D View object in a Flex Component.

http://www.flashmagazine.com/Tutorials/detail/using_away3d_with_flex/

Only when I’m done, it won’t compile because the package away3D.core.clip does not exist in the latest build, both from SVN or from github.

So I’m stuck, yet again. As always, I appreciate any help or suggestions.

UPDATED: 2011/8/2 13:27

I was not able to get Away3D 4 to work with Flash Builder so I’m giving up for now.

I was however able to get Away3D 3.6.0 to work. I downloaded the source from away3d.com and created a Flex Library Project to wrap the source in. I changed the Flex SDK of the Flex Library Project to 4.0 w/ Air 2.0

Note: The FP10 source from both the SVN and github would not compile

I created a new Flex Project using Adobe Air (Desktop) and changed it’s Flex SDK to 4.0 w/ Air 2.0

I needed to create that Flex Component from the link above so I could easily add a View3D object to my application.

The application ran and now I’m able to run the first example in the book I’m reading.

I don’t know why I’m unable to get Away3D 4.0 to work with Flash Builder. Seemed everything I tried was met with resistance.

I’ll try again, hopefully some one here can offer some assistance on why with what I tried, it would not work and why is Away3D 4 not backwards compatible with Away3D 3.6.0.

Thanks for your time and assistance,

- Rick

   

Somokon, Member
Posted: 02 August 2011 06:54 PM   Total Posts: 75   [ # 7 ]

As Richard said, Away3D 4 requires the Stage3D API (molehill), which is a part of Air 3.0.  Air 2.0 will not work with Away3D 4.

Now, as far as I am aware, Adobe hasn’t released the Air 3.0 SDK yet, only the runtime, so Away3D 4 is restricted to web projects (no desktop) for the time being.

   

Stephen Hopkins, Sr. Member
Posted: 02 August 2011 09:18 PM   Total Posts: 110   [ # 8 ]
Agilis - 02 August 2011 03:02 PM

Okay,

There seems to be a lot of misinformation when it comes to implementing Away3D as well as *old* or outdated help.

Now I have revised my steps to the following:

Using the Away3D source from here:

Installed
Flex SDK 4.5.1

Replaced the playerglobal.swc in frameworks/libs/player/10.2 with the updated version found here

Installed both the 32bit and 64bit versions of the Flash Player 11 installs for both Active-x for IE Only and for all other browsers.

Installed the 32bit versions of the Flash Player 11 debugger

Configured my Flex Project’s compiler to use

-swf-version=13 

Created a new Flex Web project so that it would reference the Away3D Flex Library Project I wrapped my Away3D Github source in.

Using the following ActionScript within a <fx:Script > script block within my main app’s MXML:
The code below results in no errors but will not run due to a configuration error within my environment

import away3d.containers.View3D;
import away3d.primitives.Cube;
   
import flash.display.Sprite;
import flash.events.Event;
   
import mx.events.FlexEvent;
   
// Private Variables
private var _view:View3D;

protected function 
windowedapplication1_creationCompleteHandler(event:FlexEvent):void
{
 _view 
= new View3D();
 
_view.275;
 
_view.200;
    
 
this.addChild(_view);
 
this.addEventListener(Event.ENTER_FRAMEonEnterFrame);
    
 var 
cube:Cube = new Cube(); 
 
_view.scene.addChild(cube); 
}

private function onEnterFrame(event:Event):void
{
 _view
.render();

Now, everything compiles, but when it runs, I receive a run-time error:

addChild() is not available in this class. Instead, use addElement() or modify the skin, if you have one.

When I change it to addElement, I receive compile-time error dealing with a coercion issue. Doing some research, I try to implement the following tutorial which wraps the Away3D View object in a Flex Component.

http://www.flashmagazine.com/Tutorials/detail/using_away3d_with_flex/

Only when I’m done, it won’t compile because the package away3D.core.clip does not exist in the latest build, both from SVN or from github.

So I’m stuck, yet again. As always, I appreciate any help or suggestions.

 

Sprites cannot be added to UIComponents directly.
The easiest and fastest way to add a sprite (View3D) to flex, is to use the SpriteVisualElement. It has the addChild method and requires no component overriding or subclassing.

 Signature 

http://www-scf.usc.edu/~shopkins

   

Agilis, Newbie
Posted: 10 August 2011 09:14 PM   Total Posts: 18   [ # 9 ]

Hello Stephen,

I was able to get Away3D 4.0 to work in an ActionScript Project after following the advice from those above. However, my goal is to get it to work within a Flex Web Project, using MXML, etc.

When I run the following code, which is the code taken from the PrimitiveTest.as file of the Broomstick examples, nothing is rendered. Intead, I end up with a blank white window. The application is calling the onEnterFrame function like it should, and tracking the mouse, but no content is rendered and there is no error being thrown.

I tried to use the SpriteVisualComponent but I went wrong some where. Can you help?

[UPDATED - 2011/8/10 - 17:25]

Okay, it turns out that scene is being rendered, but there’s a gigantic white window/plane in front of my scene blocking it from view. Now if I can figure out how to add my scene to the application without it being blocked, I’d be all set.

[UPDATED - 2011/8/10 - 17:35]

Well I figured it out. Needed to set backgroundAlpha to 0 for the Spark Application. Code below reflects the change.

Now my goal will be figure out how to make this work with the Halo theme instead of Spark

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
      
xmlns:s="library://ns.adobe.com/flex/spark" 
      
xmlns:mx="library://ns.adobe.com/flex/mx"
      
xmlns:local="*"
      
minWidth="1024" minHeight="576"
backgroundAlpha="0"
      
width="1024" height="576" frameRate="60"
      
applicationComplete="application1_applicationCompleteHandler(event)">
 <
fx:Script>
  <!
[CDATA[
   import away3d
.containers.ObjectContainer3D;
   
import away3d.containers.View3D;
   
import away3d.debug.Debug;
   
import away3d.lights.PointLight;
   
import away3d.materials.BitmapMaterial;
   
import away3d.materials.ColorMaterial;
   
import away3d.materials.methods.OutlineMethod;
   
import away3d.primitives.Cube;
   
import away3d.primitives.Sphere;
   
   
import flash.events.Event;
   
   
import mx.events.FlexEvent;
   
   
import spark.core.SpriteVisualElement;
   
   
// Private Variables
   
private var ctr:ObjectContainer3D;
   private var 
light:PointLight;
   private var 
light2:PointLight;
   private var 
view:View3D;
   
   
[Embed(source="embeds/crossColor.jpg")]
   
private var Albedo:Class;
   
   
[Embed(source="embeds/crossnrm.jpg")]
   
private var Normals:Class;
   
   private var 
camController:HoverDragController;   
   
   
[Embed(source="cubetexture.jpg")
   
private var CubeTexture:Class;
   
   protected function 
application1_applicationCompleteHandler(event:FlexEvent):void
   {
    createView
();
    
createScene();
   
}
   
   
protected function createView():void
   {
    view 
= new View3D();
    
myAway3DScene.addChild(view);
    
    
camController = new HoverDragController(view.camerathis.stage);
    
camController.radius 500;
    
    
this.addEventListener(Event.ENTER_FRAMEonEnterFrame);
   
}
   
   
protected function createScene():void
   {
    ctr 
= new ObjectContainer3D();
    
view.scene.addChild(ctr);
    
    var 
green:ColorMaterial = new ColorMaterial(0x00FF00);
    var 
red:ColorMaterial = new ColorMaterial(0xFF0000);
    var 
material:BitmapMaterial = new BitmapMaterial(new Albedo().bitmapData);
    
material.normalMap = new Normals().bitmapData;
    
material.addMethod(new OutlineMethod(0xff000020));
    
material.ambientColor 0x080820;
    
material.ambient 1;
    
    
ctr.addChild(new Sphere(green)).= -200;
    
ctr.addChild(new Sphere(red)).200;
    
ctr.addChild(new Cube(material10010010011725false));
    
    
light = new PointLight();
    
light.= -1000;
    
light.1000;
    
light.= -1000;
    
light.color 0xffeeaa;
    
    
light2 = new PointLight();
    
light2.1000;
    
light2.= -1000;
    
light2.1000;
    
light2.color 0xff2233;
    
    var 
lights:Array = [lightlight2];
    
    
green.lights lights;
    
red.lights lights;
    
material.lights lights;
    
    
view.scene.addChild(light);
    
view.scene.addChild(light2);
    
    
stage.scaleMode StageScaleMode.NO_SCALE;
    
stage.align StageAlign.TOP_LEFT;
    
stage.addEventListener(Event.RESIZEonStageResize);
   
}
   
   
private function onStageResize(event Event) : void
   {
    view
.width stage.stageWidth;
    
view.height stage.stageHeight;
   
}
   
   
private function onEnterFrame(event:Event):void
   {
    ctr
.rotationZ += .1;
    
view.render();
   
}
  ]]
>
 </
fx:Script>
 <
fx:Declarations>
  <!-- 
Place non-visual elements (e.g., servicesvalue objectshere -->
 </
fx:Declarations>
 
 <
s:VGroup width="1024" height="576">
  <
s:SpriteVisualElement id="myAway3DScene" />
 </
s:VGroup
</
s:Application

Thanks in advanced for any suggestions and/or comments.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X