I might be missing something here, but
> Cube2 is an AS class that I create from Prefab and this is the 3D
> model and I need this. It works fine unless I load from a class.
Prefab has serialized the data that you have loaded or generated into the app,
into a class.
so in Away its just a matter of saying:
import myPrefabThingy;
[.. code code..]
var myModel: myPrefabThingy = new myPrefabThingy();
_view.scene.addChild(myModel);
[..no more loading enjoy enjoy..]
Fabrice
On May 30, 2011, at 3:00 PM, andrew barry wrote:
>
> this is really annoying as I cant load an 3D object from a class.
>
> Cube2 is an AS class that I create from Prefab and this is the 3D
> model and I need this. It works fine unless I load from a class.
>
> myenemy=new ClassEnemy(view);
> myenemy.addEventListener ("enLoaded2",en_Handler);
>
> ..
>
> private function en_Handler(e:Event):void
> {
> trace ("new play x="); //nothing?????????????????????
>
> ...
> private var EnemyList:Array = new Array();
> var modelMaterial2:BitmapMaterial =
> new BitmapMaterial(Cast.bitmap(AS3Material2));
>
> model5 = new Cube2( 1);
> model5.material = modelMaterial2;
> model5.z =100;
> model5.y=50;
> model5.x=0;
> view.scene.addChild(model5);
>
> EnemyList.push(model5);
> dispatchEvent(new Event("enLoaded2")); //no error but doesnt
> dispatch????
>
> ..
>
>