Error #1007: Instantiation attempted on a non-constructor.

Software: Away3D 4.x

drbii, Member
Posted: 29 July 2014 05:54 PM   Total Posts: 72

Not sure why I get the following error during compiling in flash builder:


TypeError: Error #1007: Instantiation attempted on a non-constructor.
at Mybplugtestas/buildMaterials()[/Volumes/Toshiba/portableAdobe Flash Builder 4.7/OrthoClick_mapper_release2/src/Mybplugtestas.as:46]
at Mybplugtestas()[/Volumes/Toshiba/portableAdobe Flash Builder 4.7/OrthoClick_mapper_release2/src/Mybplugtestas.as:24]
at OrthoClick_mapper_release/initObjects()[/Volumes/Toshiba/portableAdobe Flash Builder 4.7/OrthoClick_mapper_release2/src/OrthoClick_mapper_release.as:725]
at OrthoClick_mapper_release/onContextCreated()[/Volumes/Toshiba/portableAdobe Flash Builder 4.7/OrthoClick_mapper_release2/src/OrthoClick_mapper_release.as:526]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at away3d.core.managers::Stage3DProxy/onContext3DUpdate()[/Users/robbateman/Documents/Adobe Flash Builder 4.7/away3d-core-fp11/src/away3d/core/managers/Stage3DProxy.as:529]


Flash Builder tells me that this is the line that is throwing the error is “var Level1boneplug_Bitmap:Bitmap = Bitmap(new Level1boneplug_Bitmap());”.  See below:

private function buildMaterials():void
              {
                   
var material:MaterialBase;
var 
Level1boneplug_Bitmap:Bitmap Bitmap(new Level1boneplug_Bitmap());
   
material generateMaterial("material"NaN Level1boneplug_Bitmap.bitmapData);
  
}

 } 

The code above is in Mybplugtestas.as and is generated from Prefab.

I am loading the as3 like I typically do:

_L1_boneplug = new Mybplugtestas();
 
away3dView.scene.addChild(_L1_boneplug); //l_one_boneplug
 

It seems to be the texture it does not like.  I double checked the texture for correct dimensions and it is 2048x2048.  I replaced this object with one that was created earlier and it works.  If I comment out the lines above it works (of course) but I was just making sure the code for the mesh was not corrupt.  I tried regenerating this object from prefab and it does the same thing.  I’ve created many objects with the same workflow and never seen this before and those objects are even in this project.
Any ideas!
Thanks!

   

Avatar
mrpinc, Sr. Member
Posted: 29 July 2014 07:02 PM   Total Posts: 119   [ # 1 ]

I suspect the issue is because the variable name you are using ‘Level1boneplug_Bitmap’ is the same name as the Linkage ID of the bitmap data you are creating.

Either change the name of the variable or change the linkageID of the bitmapData you are exporting from flash.

   

drbii, Member
Posted: 29 July 2014 07:13 PM   Total Posts: 72   [ # 2 ]

Ah!  Thanks!  You are a genius…and I am an idiot.
Lost so much time today because of that!  I hate when things like that eat time…

Thanks again!

   

Avatar
mrpinc, Sr. Member
Posted: 29 July 2014 07:24 PM   Total Posts: 119   [ # 3 ]

Definitely not a genius.  I don’t know you so well so I can’t comment.  Glad it’s working out though. 

   

drbii, Member
Posted: 29 July 2014 07:49 PM   Total Posts: 72   [ # 4 ]

wink 

Just going to have to remember to name my mesh layers in my 3D program or rename them in Prefab with a lowercase.

Thanks again.
Back on track (for) now.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X