Hello,
I've just put together a scene where bubbles or balls fall from above at a random x position on a timer. I have a problem I cant seem to fix:
As each bubble is added to the stage, it's briefly visible at the stage origin (0,0) before it gets moved to the new x position. I don't want it to be! I'd really love some help.
I'm setting the x position like this:
I've tried adding the child to a container_mc positioned slightly above the stage, but this seems to mess up my mouse joints. I currently have a rectangle the same colour as the stage covering the point where the objects appear, but that's no good long term.
Any help or suggestions would be really appreciated.
Thanks
I've just put together a scene where bubbles or balls fall from above at a random x position on a timer. I have a problem I cant seem to fix:
As each bubble is added to the stage, it's briefly visible at the stage origin (0,0) before it gets moved to the new x position. I don't want it to be! I'd really love some help.
I'm setting the x position like this:
Code:
bodyDef = new b2BodyDef();
bodyDef.position.x = Math.random() * 10 + 6;
bodyDef.userData = new bubble_mc();
addChild(bodyDef.userData);
bodyDef.position.x = Math.random() * 10 + 6;
bodyDef.userData = new bubble_mc();
addChild(bodyDef.userData);
I've tried adding the child to a container_mc positioned slightly above the stage, but this seems to mess up my mouse joints. I currently have a rectangle the same colour as the stage covering the point where the objects appear, but that's no good long term.
Any help or suggestions would be really appreciated.
Thanks