This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Flash Site Design > April 2006 > running a game through a browser





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author running a game through a browser
jimbobba

2006-04-20, 6:54 pm

Hi guys, I am desperate for some help any advice much appreciated! I would be
interested to hear if anyone else has had this problem and how they solved it?
I am working in MX pro 2004 and Learning Action Script and behaviours and
have
created a moving character based on these bits of code.

onClipEvent(enterFrame){
if (Key.isDown(Key.RIGHT)) {
_root.sprite._x += 10;
}
(and so on for the up, right and left)

onClipEvent (keyDown) {
if (Key.getCode() == Key.DOWN) {
_root.sprite.gotoAndStop(1);
_root.sprite.down.play();
}
(and so on for the up, right and left)

onClipEvent (keyUp) {
if (Key.getCode() == Key.DOWN) {
_root.sprite.down.stop();
}

Now when I publish it and view it through a browser the character "locks" she
doesn't
move properly or play the correct walking animations for each key press until
I click
on her! Runs fine as far as I can see when I test the movie or play it through
the flash
player, but really wanted it to be eventually uploaded onto the web.

Thanks in advance


planetnm

2006-04-20, 6:54 pm

Hi,

When you run a movie through a browser you need to first get the user to
focus the movie so that it starts to capture key presses. You can do this by
maybe having a 'Click here to play' button on your eventual title screen.
This then makes your movie capture any key presses...


Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews