IDE :: Object To Vanish When Spacebar Is Pressed

Nov 8, 2009

I am using flash 8 and actionscript 2 I am new to coding so am unsure how to perform certain tasks Im creating a game where i need, to press the spacebar button upon nearing an object and then that object vanishes.

View 13 Replies


Similar Posts:


ActionScript 2.0 :: Cause Object To Vanish When Spacebar Is Pressed

Nov 7, 2009

I am using flash 8 and actionscript 2

how to perform certain tasks

Im creating a game where i need, to press the spacebar button upon nearing an object and then that object vanishes.

View 2 Replies

AS3.0 :: Make An Object Vanish In Flash CS4?

Jul 21, 2009

I have a question on how i can remove an object when two objects hit.I have two objects on the stage overlapping.

object #1 = character_mc
object #2 = vanish_mc
 
I want to make it so that the object #2 (vanish_mc) will vanish once i run it.
 
I have this code:
 
this.addEventListener(Event.ENTER_FRAME, vanish);
function vanish(event:Event):void{
if(character_mc.hitTestObject(vanish_mc)){
// here the code to remove vanish_mc from the stage
};
}

View 2 Replies

Actionscript 3 :: FLEX - Disable Spacebar - Hold Down Spacebar And Drag The Mouse To Pan

Mar 6, 2012

When it starts, I switch tab to nr.2 (default is tab 1). I need to be able to hold down spacebar and drag the mouse to pan, but when I do this it switches back to the first tab. So the spacebar is triggering it to switch. I've tried using a custom lass that extends tabNavigator, like the code below, but it's not working. Also tried setting focusEnabled = false without luck.

[Code]...

View 1 Replies

ActionScript 2.0 :: Getting An Object To Go To A Certain Place When Push Spacebar?

Jun 3, 2009

I want a symbol (instance name: "bullet") to appear at the same x and y where another symbol ("this" symbol, the symbol the code is attached to) is when the spacebar is pushed, but only if "bullet" is off-screen. I tried the following code, but "bullet" doesn't appear on top of the other symbol ("this") when I push the spacebar:

Code:
if (Key.isDown (Key.SPACE) ) { //space key is down
if(_root.bullet._y<0) { //checks to see if "bullet" is off the screen
bullet._x=this._y //sets "bullet"'s x to "this" x

[Code].....

View 2 Replies

ActionScript 2.0 :: Disable Clicking Through An Object So It Doesn't Effect Anything Under-neath The Object When Pressed?

Feb 5, 2012

how I can disable clicking through an object so it doesn't effect anything under-neath the object when pressed.

View 9 Replies

Make A Scroller Vanish On Mouseout?

May 11, 2009

I'm using the following to reveal scrollers on mouseover, but although one replaces another when I move the cursor over the buttons, when I move the cursor away from all buttons or move to another area on the page, the last scroller I moused over remains visible -- can anyone tell me what I need to change on the following code to make the scroller vanish on mouseout?
 
on (rollOver) {
gotoAndPlay("s1");
_root.scroller.swapDepths(2998);

[Code].....

View 3 Replies

ActionScript 1/2 :: Detect The Name Of Any Object Pressed?

Aug 12, 2010

I need to detect the name of any object pressed that is on the stage. This needs to be done by simply pressing the mouse on that particular object on screen.I tried looking down the Mouse.addEventListener and myObject.target route but did not get very far. Baring in mind that this needs to be done in AS2. I have found a way to do it in AS3 but could not work out how to reverese this as so it works within AS2

View 3 Replies

Flex :: ArrayCollection - Filtered Out Images Vanish Suddenly

Dec 16, 2009

I am working in Flex. I have an arraycollection which is used to fill a tilelist with images. I am using filter method of arraycollection to filter out certain images from tilelist based on a selected value from combobox. The issue is that when the images are filtered out they just vanish suddenly. But I want to give some effect to them when they are filtered out, say slow fade effect or zoom effect. I tried removedEffect, hideEffect etc. but in vain.

View 1 Replies

ActionScript 3.0 :: Mouse Over Actual Panzoom Animation Graphic Causes All To Vanish?

Jun 25, 2010

see code below. We have movieClip called Map_Collection (in properties) within which are movie clips BusRoute_42 and BusRoute_43 (in properties) as well as the basic map artwork graphic. These are lines that glow (motion tween alpha1% to 100% to 1%) when buttons outside of the map boundary are clicked on. Buttons sit on Scene1 stage outside of the map area and are named in properties Button42 and Button43
 
Coding also makes the map zoom and pan, using mix of freesource whitecat redcat and greymouse coding for pan and another for zoom with focus at mouse location.
 
The problem:-
1) Map route glows ok when button clicked, and pan zoom is ok until user happens to shove map around just on the location of the glowing line, the entire flash movie then goes white, all artwork vanishes.. Why ? Near it ok, but on it, zappo !

2) zoom works but zoomout eventually inverts then gets larger !
 
Envirographics
 
PS I dont suppose there is a way of copy pasting code in from CS5 retaining the colouring of it ?

[Code].....

View 3 Replies

ActionScript 3.0 :: Have Buttons Pop Up In Random Locations On The Stage And Vanish After A Set Amount Of Time?

Apr 11, 2010

Is there a way to have buttons pop up in random locations on the stage and vanish after a set amount of time? I'm a total noob at Actionscript.

View 3 Replies

ActionScript 3.0 :: Make A Button That When Pressed It Resets/changes The Position Of A Object?

Nov 6, 2010

button to reset position (action-script 3)  how do you make a button that when pressed it resets/changes the position of a object yes i am new to action script 3 but not to flash i want button to change the x y coordinates back to the original but dont know how?     

View 1 Replies

ActionScript 2.0 :: Move An Object Along The X Axis Continuously After A Button Is Pressed?

Jun 30, 2010

I want to move an object along the x axis continuously after a button is pressed until the object reaches a point. How can I achieve this?

View 9 Replies

ActionScript 2.0 :: Make A Box That Fades In When Pressed On The Button And Fade Out When Pressed For The Second Time?

Nov 16, 2004

I have a function on root:

_root.fadeBox_mc.onEnterFrame = function (){
if (fade){
this.nextFrame();[code]....

This causes a mc to fade in and out on rollover/rollout. But what I wanna make is a box that fades in when pressed on the button and fade out when pressed for the second time. But if I say

on (press){
_root.fade = true;
}

the mc fades in, but I cant do another on (press) to fade out. Is this too confusing?

View 2 Replies

ActionScript 1/2 :: Keys Pressed Or Not Pressed?

Dec 6, 2010

I am struggling a bit with keys on the keyboards controlling a movieclip to happen.Ive got a person moving when pressing right and left, and a movieclip with three frames: First frame is a movieclip with the person standing still, looking bored. The second frame is the person moving right, and the third frame is the person moving left.This is the code that Ive inserted into the persons actions on scene1:

if (Key.isDown(Key.RIGHT)) {_x += speed;this.gotoAndStop(2);_xscale = +scale;} 
if (Key.isDown(Key.LEFT)) {_x -= speed;this.gotoAndStop(3);_xscale = -scale;}
 
this code works alright accept that when the keys are not pressed it doesnt stand still, the legs are still moving, so I tried to include this code aswell:

if (!Key.isDown(KEY.RIGHT)) [code]....this makes the person standing still when not pressed but not moving the legs when turning right and left.

View 3 Replies

ActionScript 2.0 :: Multiple Conditions - An Object Will Go To A New Frame If Multiple Buttons Are Pressed?

Aug 12, 2009

i have an if statement, an object will go to a new frame if multiple buttons are pressed

PHP Code:[code].....

now i want it so that if one condition is met the mc will goto frame 2, if 2 conditions are met, frame 3 and if 3 conditions are met, frame 4.i know i could do this with a lot of if statements but i have a lot of movie clips to use this code on, so is there any way to write an if statement that will trigger different options if multiple conditions are met?

View 4 Replies

ActionScript 3.0 :: Go Fullscreen With The Spacebar?

Jun 11, 2011

finding a script that makes it possible for me to go fullscreen with the spacebar? I only found mousekey full screen scripts.

View 6 Replies

Presentation - Using Spacebar - Embed Movies

Sep 7, 2009

I am doing a presentation in flash similar to a Powerpoint one but I want to embed movies.... add code so it works like a powerpoint ie on spacebar goto next frame?

View 1 Replies

ActionScript 1/2 :: Spacebar As Pause Button?

Sep 10, 2009

I'm trying to code the space bar key as a pause/play function in my flv player. I'm using Lee Brimlow's flv player tutorial as a model for my flv player so essentially it's driven via netstream coding. I've tried two different codes, code 1 being something I used a while back on another project and code 2 something I've been trying (hoping) would work better.

Code:
//1)
onEnterFrame = function(){ check_keys();}

[code].....

View 1 Replies

ActionScript 1/2 :: Can't Use The Spacebar In Input Text?

Oct 23, 2009

I've been posting a few things about input and dynamic text in Flash on here I know, but this one has just got me stumped. Do input text fields not recognize the spacebar? I was typing in my input text field in my movie, and noticed I couldn't add space between words.Any way to work around this, or is my little brain just missing something again?

View 1 Replies

ActionScript 1/2 :: Having To Unpress Spacebar And Then Press It Again?

Jan 20, 2010

Im making a rock band 2 drum style game and i've come across a problem. Whenever theres 2+ notes together, all i have to do is hold down the button ( in this case space ) and it hits both of them without any penalty (which i havnt come across yet). But what i would liek it to do is that when u come across these notes you have to release space then press it again or else the note wont hit. Here is the code i am currently using.
 
onClipEvent(enterFrame){if(_root.hitspace.hitTest(this)&&(Key.isDown(key.SPACE))){  _root.score+=50;  _root.streak+=1;  unloadMovie(this)}if(_root.spacehitbad.hitTest(this)){  _root.score-=50;  _root.streak=0;  unloadMovie(this)}}
 
Where hitspace is the part where the note has to come in contact with when u hit the note. and spacehitbad is the back where if the note hits that it means you have missed the note.

View 9 Replies

ActionScript 2.0 :: Play Movie With Spacebar?

Jan 14, 2010

I am very new to flash and am putting together a simple presentation at work. When I save out my .swf file I have to press cmd+p to play the movie. I have been asked to change that to the spacebar.The movie simply plays through part of a presentation then stops. I need to be able to play the movie with the spacebar at each stop.

View 3 Replies

IDE :: Go To/Play Next Frame On Mouseclick Or Spacebar?

Dec 2, 2009

I'm going to by chance include a message I sent out to a colleague in the off-chance someone also has a solution to it, but it also pertains to my issue. Skip to the bolded part below for just the question I have.I've been tasked with converting a Powerpoint presentation into a Flash presentation. I was considering manually doing it, but it seems like it would take an awful long time (240 slides, with videos and animations) - plus I don't know how to export the animations on individual slides over to Flash other than recreating them entirely.

I found a handful of programs on the Web that advertise that they will convert PPT to Flash (swf) and I tried a few to see which if any I should purchase. All of them had issues. Some either didn't run entirely or the end result was graphically ugly, videos weren't carried over (a problem I could easily rectify if the thing was an FLA where I could add videos back in that way), or animations were either mangled or ignored completely.how best tackle this challenge?Okay, so I basically started to just recreate the entire thing in Flash, using PrtScrn for backgrounds after deleting objects (then pasting in Photoshop and exporting as a PNG-24), as well as copying graphics into Photoshop as well to export as PNGs. No idea what to do about animations yet. Videos I can add back manually.

But anyways, as I do this, the movie is automatically advancing through every frame when I preview. I'm not sure how to go about setting up my Flash so that it only goes to the next frame when someone either presses the mouse button or the spacebar (either would be fine, I think).So that's my main focus at the moment. The other stuff is definitely part of the whole deal, but my main question is:ow do I set up Flash so that it only advances to the next frame when a mouse button or spacebar is pushed?

View 1 Replies

ActionScript 3.0 :: Cause A Menu To Display When Spacebar Is Held Down?

Jun 11, 2009

Is it possible to make a menu display when the spacebar is held down, then, disappear once a menu option is chosen and the spacebar is released?

View 3 Replies

ActionScript 3.0 :: Get A Character To Jump Up When Press The Spacebar

Aug 26, 2010

I am trying to get a character to jump up when I press the spacebar and come down by himself but am having a dickens of a time doing so. Here's the code I am using: This is the LevelOne class, there is also a player class:

[Code]....

View 5 Replies

Professional :: Spacebar Variable For Form Validation?

Feb 5, 2011

I am putting together a Flash Form. I had it all finished and posted it on a testing site, then I realized there was a problem.I have form validation that works like this. If a user hits the submit button but has not entered information in all of the required fields, the user will get an error message telling them to input all required information. However, there is a workaround. It seems that Flash sees the value of the "spacebar" as a positive value and lets users get past my validation.I need to assign the "spacebar" a value, make it a variable, or something along those lines. Then tell it to be equal to "0", which is not an acceptable number to pass my form validation.

View 5 Replies

ActionScript 3.0 :: Play / Stop Timeline With Spacebar?

Sep 25, 2011

Normally I have a 'MouseEvent.CLICK' on a movieclip handle this but I want use the keyboard instead of the mouse this time. I haven't used the keyboard for button actions since AS2, any tips on how I can do this in AS3?

View 1 Replies

ActionScript 2.0 :: Spacebar Playback / Replay Control

Jul 10, 2010

I need to have a swf playback be stopped at launch, but pressing spacebar starts playback. Pressing space bar again before the end is reached will pause playback until it is pressed a second time.When the end is reached, I need to pause on the last frame. Only pressing the spacebar again will cause the the animation to goto the first frame (essentially resetting the animation).I am using the following actionscript, but it takes three spacebar presses to get the animation to replay once the end is reached.[code]

View 1 Replies

ActionScript 3.0 :: Add Pause / Play Via Spacebar To External SWF

Oct 18, 2010

I have been searching all morning and cannot find a solution to this. I have a 60MB SWF published from Camtasia and I would like to add the ability to pause/play the clip using spacebar. The file is too big to import into the library (Flash CS5) or at least I assume so because it keeps crashing when I try. So I thought I would create a new flash movie and have it just reference the clip externally. I have tried a couple methods each are resulting in different errors.

[Code]....

View 2 Replies

ActionScript 3.0 :: Starting Animation On Hitting Spacebar

Nov 14, 2010

I have this standing person (its a MC) and another MC that is the same person but in a jumping position. And the thing is that I want that jumping person to appear when the Space bar is hit, and the standing person to disappear. But when the space bar is released the jumping person disappears and the standing reapers. I know it has to be an if statement, but I'm not sure do I addChild, cause both of these MC are strings on the same timeline.

View 5 Replies







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