PDA

View Full Version : [AS3] my mcs won't play


spaceboots06
03-04-2010, 07:44 PM
Hi everyone,

I'm trying to make a shooting game. Big surprise.

Anyway, I have a document class, and I have a few other class files. One is a weapons class file.

I have a weapons movie clip that has a bunch of other weapon movie clips in it. These have motion tweens in them.

The problem is that they do not play when I ask them to play.

I.e.

public function playAnimation(e:MouseEvent)
{
trace("we are in business");
if(this.currentLabel=="bat")
{
trace("in terms of a bat");
this.bat.gotoAndPlay(2);
}
else if(this.currentLabel=="magnum")
{
trace("in terms of a magnum");
this.magnum.play();
}

the trace statements come up fine, and there are no compile errors or output errors. my movie clips just won't play.

Any suggestions?

Also, another question. I have to click the stage with my mouse before I use my weapon select buttons, which are keyCode 49 50 51, etc (keyboard buttons 1, 2, 3). Why is this?

thank you for any help.

I can post more code if need be.

spaceboots06
03-09-2010, 10:08 PM
bumping this

+24 hours has gone by and it has reached page 2.

Impacatus
03-11-2010, 02:39 AM
I have no idea why your movieclips aren't playing. If your project is small, you could try attaching it to your post so we can see it.

Also, another question. I have to click the stage with my mouse before I use my weapon select buttons, which are keyCode 49 50 51, etc (keyboard buttons 1, 2, 3). Why is this?
This is probably a matter of keyboard focus, possibly within your project but more likely in your operating system. Clicking tells your computer that the flash is what you're using at the moment, so it knows to send your key hits there. You can make sure your players click on the flash by having a "start" button at the beginning.