I have an unusual problem.
I have placed 7 objects in flash onto the timeline, for a specified interval, they sit there and do nothing at all ... I have an AS3 layer that kicks in, and all 7 objects are removed from their original layer and replaced with 7 objects set up for physics with Box2D. The positions need to be exactly where the old static positions were ... so I just copied from the Flash Properties window and entered into the code where they are initially placed onto the scene ... as such.
The objects are all pulled from PhysicsData, into an array, then it's parsed and each body is added, and the x and y is defined depending on what the object is called... this all works fine.
I've tried changing the X to various values, using the pixel to metre ratio, not using it, applying different methods of initially placing the objects, ... all manner of coding, but no matter what, the first frame flashes up every single object all placed into the one single point, ... Then every frame after that the objects are all where they are meant to be, and behave correctly as intended. I've tried everything, but it's rediculous.
I can't get this one frame to bugger off!
I have placed 7 objects in flash onto the timeline, for a specified interval, they sit there and do nothing at all ... I have an AS3 layer that kicks in, and all 7 objects are removed from their original layer and replaced with 7 objects set up for physics with Box2D. The positions need to be exactly where the old static positions were ... so I just copied from the Flash Properties window and entered into the code where they are initially placed onto the scene ... as such.
The objects are all pulled from PhysicsData, into an array, then it's parsed and each body is added, and the x and y is defined depending on what the object is called... this all works fine.
Code: Select all
if (value == "floor")
{
x = 0 / physicsData.ptm_ratio;
y = 720 / physicsData.ptm_ratio;
}
body.SetPositionAndAngle(new b2Vec2(x, y), 0);
// add the sprite to the scene
addChild(bitmap);I've tried changing the X to various values, using the pixel to metre ratio, not using it, applying different methods of initially placing the objects, ... all manner of coding, but no matter what, the first frame flashes up every single object all placed into the one single point, ... Then every frame after that the objects are all where they are meant to be, and behave correctly as intended. I've tried everything, but it's rediculous.
I can't get this one frame to bugger off!