ActionScript 3.0 :: Flash New Game - Set Up The Key Press And Know Space Is 32?

Jul 14, 2010

I am currently working on a new game and I need help on this part. It is probably simple to do but I am a noob. Basically I am making a window cleaning game and I have set it up so that the dirt slowly dissapears through the frames. What I need to know is how to I script it so that each time I press space it jumps to each frame.

e.g hit space jump to frame 2 press again jumps to next frame.I know How to set up the key press and know space is 32..

View 4 Replies


Similar Posts:


ActionScript 3.0 :: Stage - KeyboardEvent - When The Game Ends And I Press Restart, The SPACE Key Is Not Working?

Dec 17, 2009

The problem is: when the game starts, "SPACE BAR" is working fine and changes the game from day to night. When the game ends and I press restart, the SPACE key is not working. On the third time it works, on the fourth not and it follows that way. Every second time that I play the game, the SPACE key doesn't work.

The game initializes the player and sends him as a parameter a stage object and the player listens for KEY_UP.When I press restart, the game runs the init() function again.Below there are the Game.as and Player.as classes.

Code:
package
{
import com.greensock.TweenLite;[code].....

View 2 Replies

ActionScript 1/2 :: Tetris Game - Block Go Directly To The Bottom On The Press Of "space"?

Apr 10, 2010

I'm using AS2 and fps120.I'm creating a tetris game, but I encountered a problem: I made a function which makes the block go directly to the bottom on the press of "space".I used

if(Key.isDown(Key.SPACE)){
...
}

But when I pressed space, the blocks stacked up immediately. It's because after I press space, another block apears immediately and goes to the bottom immediately, and keeps going until I release spade. It isn't a problem if I use lower fps, but my fps is 120, which means even I release space as quickly as I could, at least six blocks would stack up. I want to know is there anyway to detect the releasing of "space" or a detection which only detects on the instant I press, instead of when the key is down.

View 3 Replies

ActionScript 2.0 :: Make On Key A - Press A Instead Of Space?

May 24, 2004

This is a code that I have on a movie clip:

onClipEvent(enterFrame){
if (Key.isDown(Key.SPACE)){
_root.acc = 2;[code]....

How do I make on key A - so you can press A instead of Space?

View 3 Replies

ActionScript 3.0 :: Press Space Bar And Create A Line?

May 7, 2010

How would I go about creating a function where, when the space bar is pressed and held down it creates a continual line (that flows until you release the space bar)

View 3 Replies

ActionScript 2.0 :: Increase Var Everytime Press Space?

Feb 17, 2009

I have a var defined and that is colour var colour = 0; and I want to increase var everytime you press space so I have an invisible button with this code in it

on (keyPress "<Space>") {
colour+1;
}

This is so that I can advance in a movieclip. I have the code for that here:

onEnterFrame; {
if (colour == 1) {
head.gotoAndStop(1);
}

[Code].....

View 5 Replies

ActionScript 2.0 :: Firing One Bullet Per (Space Key) Press

Jul 27, 2004

I am just testing some stuff, and everytime the space key is pressed I want one bullet to come out, however righty now you can just hold down space and it keeps firing...here's the code i used :
on (keyPress "<Space>") {
i = i+1;
duplicateMovieClip(_root.bullet, "bullet"+i, i);
}

View 11 Replies

ActionScript 3.0 :: Press Space Bar To Launch Some Missiles Up The Screen?

Oct 19, 2010

I press space bar to launch some missiles up the screen.My code works it is just I cant fire 1 missile at a time because pressing space bar to fire , then 2-3 missiles go at once.
//main

Code:I press space bar to launch some missiles up the screen.My code works it is just I cant fire 1 missile at a time because pressing space bar to fire , then 2-3 missiles go at once.

/main
if (dict[Keyboard.SPACE]==true ) {
myplayer.firemissile(mybackList); [code].....

View 2 Replies

AS3 :: CS3 Space Invaders Game

Mar 15, 2009

I am making a space invader game as a uni project. Please seee attched file.I am getting an error:TypeError: Error #1009: Cannot access a property or method of a null object reference. at MethodInfo-19()It only happens sometimes when an invader is removed in the moveBullet method I think but basically the game behaves incorrectly and sometimes goes to the You Win frame even if the user has lost or just lost a life.

View 1 Replies

ActionScript 1/2 :: Start Game With Space Bar?

Aug 26, 2011

My project is almost complete except for this last little thing that's been bugging me. A tutorial I followed had you start the game by clicking a button but I would like to change that to pressing the spacebar starts the game. I tried:

if(Key.isDown)(Key.SPACE))
{
_root.ship.newGame();
}

[Code].....

View 3 Replies

ActionScript 3.0 :: Making A Space Invaders Game

Sep 26, 2009

how to make a Space Invaders game (with a twist). I have previously made a game in Actionscript 1.0, which may be viewed at [URL] (press S to start the game after typing in your name).

I want to use this project as an exercise for learning AS 3.0, and I a cannot really see how I need to use separate AS files (Actionscript classes)

View 5 Replies

ActionScript 3.0 :: Color Objects That Are Flying Around In Space Game?

Jul 5, 2011

trying to color objects that are flying around in my space game.When I shoot and hit them - the affected enemies shall blink. The graphics are pre-rendered (i.e. there's an rotation array and function where the degrees and their appropriate rotation for the objects are stored / calculated for better performance).

So - my idea was to enhance that rotation function with a functionality for additional coloring; but the colored AND rotated objects shall be stored apart of the normal rotated objects. To accomplish this I made a nested array:in row one there are 360 rotated graphics of one object and in row two there are 360 graphics of a rotated and colored object.

Problem: Coloring works but they are not rotated (always at 0 degrees).

Code:
public function createRotationWithColorBlitArrayFromBD(sourceBitmapData:BitmapData, inc:int, offset:int = 0):Array
{
trace("sourceBitmapData.width=" + sourceBitmapData.width);

[code]....

View 4 Replies

ActionScript 2.0 :: Space Game - Remove Fuse Movieclip?

Jan 7, 2005

I tried to do a space game But there is a big big big problem I couldn't remove the movieclip (bomb)Here is the fla CAN YOU HELP ME?

can you remove the "fuse" for me

View 5 Replies

ActionScript 3.0 :: Shooting Multiple Bullets - Press The Space Bar The First Bullet Disappears And The Bullet Animation Starts Again

Nov 24, 2008

I'm trying to make my platform game character shoot a gun, my character and gun are one movieclip and the bullet is another. The bullet mc starts on a blank frame with a stop() function, when I press the space bar the bullet mc plays from frame 2 which is a motion tween of the bullet quickly moving across the page. I've set the bullet's y and x values relative to the character mc so that the bullet always comes from the gun.

My issue is that if I press the space bar a bullet will fly out of the gun (great!) but if I press the space bar again, the first bullet disappears and the bullet animation starts again. I want to be able to shoot a new bullet every time I press the space bar without effecting the bullets that have already been shot.

[Code]....

View 3 Replies

ActionScript 3.0 :: Making Game - Zoom In And Out By Holding And Letting Go Of The Space Bar?

Dec 28, 2010

I am making my first game and it's my first time using actionscript. I am making a sniper game themed with the L96A1 sniper rifle from COD: Black Ops and the map nuketown. I'm in cs5 with ac3 and on my stage I have two movie clips that I'm working with. I'm not really sure if they're supposed to be movie clips though. Anyways, one is the gun, and the other is the zoomed in scope overlay thingy.

For now, I'm trying get the zooming in to work. I haven't done anything else though except collect graphics for enemies, the landscape, the gun, and the scope. I want to make it so that you zoom in and out by holding and letting go of the space bar. Also,I want to make it so that when you are not zoomed in, the gun moves horizontally at the bottom of the screen (aligned vertically with the cursor). And when you are zoomed in, the scope crosshair is the cursor.So my idea was to set the gun as the cursor and make it only move horizontally at the bottom of the stage and then make an event listener that listens to when the spacebar is pressed and when it is, disables the gun as the cursor (and makes it transparent to get it off the screen) and makes the scope the cursor [was transparent, now opaque and unrestricted(vertical movement also)].

I got as far as making the gun move horizontally at the bottom with the cursor. I cant get the event listener working because I don't really know how to go about changing the opacity of each movie clip and how to switch cursors. So I am asking how do I change the opacity and switch the cursors when the spacebar is held and then reverse those changes when the spacebar is released? Here's my code on an "actions" layer [I haven't done any animations yet, so everything is on frame 1. Also, I used a couple preset code snippets since I have no previous experience with actionscript (I can understand most of it though)]:

Code:
import flash.events.KeyboardEvent;
// make gun cursor
stage.addChild(gun);[code]..........

Here's a link to a zip archive with all the files used so far (I hope this google docs link works): link

View 2 Replies

ActionScript 3.0 :: Simple Space Ship Game - Motion Synchronization

Oct 12, 2010

I was trying to make a game with simple spaceships and a bullet that is supposed to hit them and delete them on screen. As all ships are deleted the level gets up by one, increasing number of ships to delete. I think the collision detection part of my program works fine, but their is some problem in their motion synchronization.

Code:
package {
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
public class HitGame extends Sprite {
[Code] .....

View 6 Replies

ActionScript 3.0 :: Attempting To Make An Up-side-down Space Invaders Like Game?

Dec 18, 2010

I've been following a tutorial on [URL] but changing and removing various things to fit to the game I am (very, very slowly) trying to make. I am attempting to make an up-side-down Space Invaders like game, but with balloons instead of aliens.

So far (by following the tutorials and being lucky) I have managed to make the player's ship which moves by pressing the arrow keys and can shoot two (blue) lasers when the spacebar is pressed. The enemy balloons randomly appear below the bottom of the screen and shoot a laser upwards towards the player's ship when the player goes above (Y axis I think) any balloons.

The problem is that the balloons fire a massive stream of shots (red lasers), but I want to delay each next shot by a few seconds, but the time of the delay doesn't matter because I'll tweak it later.

I've been trying to make delays for the balloon lasers by copy/pasting bits of code from Ship.as in an attempt to make it work ...Maybe it's a good time to say I am a complete noob at AS3 apart from when it comes to messing up and having no idea what is going on

I've attached my current (broken) work and a working SWF of before trying to add delays to the balloons shots. If you want to see it working first hand then replace the Balloon.as in actionscript.game with the Balloon(working).as and change the filename to Balloon.as.

View 1 Replies

Actionscript 3 :: Flex Alert Control: Activating The "default" Button On Enter/space Key-press?

Dec 17, 2009

No matter what I try, I can't seem to fire the click event on the "default" button in an Alert control in a Flex 3.4 application.

[Code]...

View 1 Replies

ActionScript 3.0 :: Creating A Vertical Scrolling Space Shooter Game For Deployment On Mobile Platforms Using AIR?

Oct 22, 2011

I am in the process of creating a vertical scrolling space shooter game for deployment on mobile platforms using AIR.I've used some excellent tutorials online, video tutorials on Lynda and several books, including Game Programming University.Something they all seem to gloss over are the various screens that will be used.

For instance, my game right now will use a splash screen, a main menu screen, a credits screen,a settings screen, a difficulties screen, an instruction screen, an end game screen and save/load screen...and a play game screen, where the actual game will be played.I've created the screens as seperate frames in the main timeline with stop commands in between and code on each page (I know... bad!... but easy).So basically,they can navigate through the menus using buttons (mouseclicks, which will work with touchs as well) and when they are How do I pass data between them? I was thinking of storing it in shared object.

View 1 Replies

ActionScript 2.0 :: When Press A Button Mc Starts A Countdown But Every Other Press Doesn’t Reset It?

Jan 13, 2009

How can i make it so a when you press a button it starts a countdown but every other press dosent reset it?

View 14 Replies

ActionScript 3.0 :: Combine One Tab Press And Continuously Press On Keyboard

Mar 13, 2010

I have a problem when I making a game Flash with action script 3,. I want tomake my character move when the key helding and I want  my character attackwith one tab press either

View 3 Replies

ActionScript 1/2 :: Press +1 Text Increases By One, And When Press -1 It Decreses

Aug 29, 2011

I have text field which is 0 by default (score_txt)Two buttons +1 and -1 (plus_btn and minus_btn) When I press +1 text increases by one, and when i press -1 it decreses

View 4 Replies

ActionScript 3.0 :: Flash - Writing A Simple Game Rule For A Platform Game?

Feb 28, 2011

I'm creating a game at the moment for my university course and it involves the player character jumping on top of boxs twice to break them as opposed to just once.What would be the most efficient/simple way of writing this in Actionscript 3.

View 1 Replies

Actionscript 3 :: Flash Game Engine Selection Of An Awesome Game?

Dec 14, 2011

I am thinking of developing of a game like this: [URL]... Do you have any idea - by which game engine I may develop this type of games? I am not sure whether I have to use any 3d physics engine? I think JiglibFlash may be useful, but I am not sure.

View 1 Replies

Actionscript 3 :: Make A Game Tutorial Of Flash Game?

Apr 1, 2011

how to make a game tutorial as farmville game tutorial to teach the user to play the game. i have recently involve in make that kind of game tutorial for its user by actionscript 3

View 1 Replies

Flash Games - When Game Page Loading , The Flash Game Itself Does Not Appear?

Feb 15, 2010

When game page loading , the flash game itself does not appear ( just white area as the holder of the flash game) untill the game almost finish downloading, then it appears .. This long waiting with just white area makes visitors leave, thinking there was nothing there.

View 1 Replies

Flash :: Made A Game And In The Game?

Oct 20, 2009

well i made a game and in the game there is music at the first frame and when u lose to goes back to first fram and more music plays so they are overlapping.

View 10 Replies

ActionScript 2.0 :: Press Start Drag On Press Stop Drag?

Jun 17, 2005

i have an object that i want to drag and drop with the same event.Something like on press start drag and on press again stop drag. I'm sure it's pretty simple with and if and else statment but i can't find how to do that...The best i have done so far was this:

[Code]...

View 4 Replies

Flash 9 :: How To Remove Space

Nov 30, 2008

how I rid myself of that 1"+ of white space above my rotating images:Here is the script currently employed:

<object align="top" height="600" width="600">
<param name="movie" value="http://www.smugmug.com/ria/ShizamSlides-2007090601.swf?AlbumID=6453203&AlbumKey=tZa2b&tran sparent=tr ue&crossFadeSpeed=800">
<param name="wmode" value="transparent">

[code]....

View 0 Replies

Extra Space Around Flash Object?

Oct 21, 2009

I have a flash object embedded inside a div, and for some reason it has like 10pixels space under it. Here is my code

Code:
<div class="content">
<object width="932" height="350">
<param name="movie" value="fade.swf">
<param name="wmode" value="transparent">

[Code]......

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved