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!