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


Similar Posts:


ActionScript 3.0 :: Fade Out A Complete Stage When A Button Is Pressed

Sep 18, 2009

how to make the whole stage fade out when going to an external website. How can you achieve this effect when you pres a button?

View 4 Replies

ActionScript 2.0 :: Conting Time Since Button Is Pressed?

Jul 24, 2006

I was thinking about using the getTimer() action for counting the time, but what I need is to count the time since a button is pressed. when the counter get to a determed number, it should go back to zero and start counting again when the button is pressed again.

View 4 Replies

IDE :: Forward One Frame Each Time Button Pressed?

Apr 4, 2009

This is probably a very simple actionscript question I am using CS3 on an AS2 movie. I want to make a simple audio level bar and I created a movie clip with ten frames and ten squares that appear in a line. On each frame you can see one more square i.e. from 1 to 10.What I want is to have a + button on the main time line and every time it is pressed it advances on the frame of a movie clip called loader_mc to the next frame. Similarly if I press minus button the movie clip goes back a frame.This is the actionscript i tried but it only works once. It doesn't keep moving on each frame.

Code:
on (press) {
_root.loader_mc.gotoAndPlay(_currentframe+1);

[code].....

View 2 Replies

ActionScript 2.0 :: Button Not Working When Pressed Second Time

Jan 27, 2005

There is a problem with my button.
Code:
stop();
_root.enter_btn.onRelease = function() {
_root.up_mc.onEnterFrame = function() {
_root.up_mc._alpha += 5;
if (_root.up_mc._alpha>100) {
[Code] .....
This code works only ONE time) the second time i'm pressing the button - no effect.

View 2 Replies

ActionScript 1/2 :: Value Not Written To Variable Until Button Pressed 2nd Time?

Feb 28, 2012

When the button is first pressed, I can see in my debugger the data LocalID has a value, but why doesn't it write to the _root.PrimaryID until I press the button a second time?
submit1.onPress = function(){
getDatax.UniqID=UID;//Long string version of ID
getDatax.sendAndLoad("GetID.cfm", getDatax, "POST") ;
getDatax = new LoadVars()
getDatax.onLoad = function(){
if(this.writing=="Acquired") {
_root.PrimaryID=this.LocalID;
}}}

View 1 Replies

ActionScript 3.0 :: Count The Time When Button Is Pressed To Let Char Jump?

Jul 5, 2011

I have to make a game. in that game there are some notes on the wall. The character (here emma) can be moved by the player with the left and right arrow key. If you press the up key, there should be a function so that you have to keep it pressed for a while, to let her jump, thus making her jump to the notes, so she can get them.
 
here's the code:

//notes on the wall
var teller:Number=1;
for (var i:uint = 1; i<=4; i++) {

[Code]....

View 8 Replies

ActionScript 3.0 :: Detect Number Of Times A Button Has Been Pressed - Attach New Mc Each Time?

Feb 7, 2009

with the following problem:I have 1 button that when hit 1 time shouldplay "movieclip 1"when hit for the second timeplays "mc 2"on so on untill mc9(each movieclip plays continously when once activated)

View 0 Replies

ActionScript 2.0 :: Make A MC Vibrate When A Button Is Pressed?

Mar 27, 2004

How do I make a MC vibrate when a button is pressed? I made a button but I don't know what to put after the event handler:

View 2 Replies

What Button Event Should Use To Make The Program Understands To DO SOMETHING Only When The Button Is Pressed / Dragged

Aug 4, 2009

What button event should I use to make the program understands to DO SOMETHING only when the button is pressed/dragged. In my sample code below, I want something to happens only if the button is dragged beyond 200 in y axis. I tried onRelease, onRollOver and onDragOver but still not working

[Code]....

View 6 Replies

ActionScript 3.0 :: Make That Function Play When A Button Is Pressed?

Jan 4, 2009

I have a very basic question. I have a custom class called caurina. I've imported the class and it works great. What i did is use that as a function called slide().

What I would like to do is make that function play when a button is pressed. I can't seem to find out how to do this anywhere. I am using as3.

Summary: When btn is pressed go play function slide()

View 6 Replies

ActionScript 3.0 :: Make A Button Turn On/off A Sound When Pressed?

Jan 29, 2009

I am trying to make a button turn on/off a sound when pressed. I have tried to code it, but it does nothing everytime.

I have a sound in the library, with a linkage name of "sound" it is on the first frame in the main timeline. And i need a button to turn it off, and then on again.

View 0 Replies

ActionScript 2.0 :: Make A Button Write Text When Pressed?

Jul 14, 2010

What command would i use if i wanted to be able to click a button and when i do that text apears in teh dynamic textbox?

View 3 Replies

ActionScript 2.0 :: Make Balls Fall Down When Button Is Pressed?

Mar 25, 2011

I wish to have a numeric stepper which allows me to choose the no of balls I want, then when i press the button I want all these balls to fall down..but when I press the button the x no of balls are generated but not falling down.

View 6 Replies

ActionScript 2.0 :: Make A Button That When Pressed Opens A Window?

Aug 4, 2003

i am trying to make a flash site, and anyway i got some problems i want to make a button that when pressed opens a window (set size of 500 400) what actions should the button have?

View 4 Replies

ActionScript 2.0 :: Fade In White Movie Clip Over Main Movie When A Button Is Pressed?

Aug 30, 2006

I am looking for a way to fade in a white movie clip over my main movie when a button is pressed.

(i.e. When you press a button, a white rectangle will fade in over all other layers and then fade out after a couple of seconds. This is to make it look like the different pages are fading in and out without having to build the transition over and over again.)

View 8 Replies

ActionScript 3.0 :: Make Button's Function Execute Once Without Button Being Pressed

Sep 26, 2009

I have a function that executes when a button is pressed:

btnRandomAll.addEventListener(MouseEvent.CLICK, clickHandlerBtnRandomAll);
function clickHandlerBtnRandomAll(e:Event)
{

...but, I need it to also execute once, upon the file loading.

View 7 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 :: Make MovieclipS Perform An Action When The Button Is Pressed?

Mar 24, 2011

I have a numeric stepper which allows the user to choose as many balls as they want, then they shud press the button and all of those balls should fall down. How can I do this???

View 1 Replies

ActionScript 2.0 :: Make A Button That When Pressed Creates A Movie Clip From The Library?

Jun 21, 2011

1. How to make a button that when pressed, creates a movie clip from the library? So let's say there's a movie clip called "Guy". When I press the button, it creates "Guy" at a certain position.

2. I have a shooterish game, and I want different enemies to affect the healthbar differently. So what I have for my healthbar is a 150 frame tween of a healthbar going down. On a basic enemy that deals 1 damage/frame, I have this:

[Code]...

"marine" is my character, and "bar" is the healthbar. So to make it go down multiple frames at one time, the only way I know of is:

[Code]...

View 9 Replies

ActionScript 2.0 :: Create A Button That When Pressed Will Make An Movie Clip Visible?

Feb 22, 2003

I am trying to create a button that when pressed will make an movie clip visible and set it to a specific position on the screen. When this same button is pressed a second time the movie clip will become invisible.

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 :: Both Keys Pressed At Same Time?

Jun 14, 2010

if (Key.isDown(Key.RIGHT)and (Key.isDown(Key.LEFT){
trace("both pressed");

i am trying to write the syntax to detect left and right cursor keys .pressed down at same time.

View 1 Replies

ActionScript 3.0 :: Store Pressed Along With The Date And Time

Mar 20, 2012

There must be a kind person out there on the WWW who could spare me 5 mins and rescue me before I top myself! I have a movie clip on my stage with 8 buttons in it that all sequentially fade in via an alpha tween 0 to 100%. All the buttons simply link off to different URL's on click. What I want to do is when a button is clicked I want to store pressed along with the date and time it was pressed into a .csv file.

View 1 Replies

Professional :: Interactive Button Is Clicked A Circle Graphic Fades In / Fade Out

Mar 27, 2010

I am working on creating an interactive map. When a button is clicked a circle graphic fades in. When the same button is clicked I want the graphic to fade out the same way. I can only figure out how to make the graphic instantly disappear instead of fading out. I am following a tutorial and changing it to my needs. The tutorial can be seen here: [URL] The steps for the animation start at step 8. Here is the code I am using:

[Code]...

I am using Flash CS3 and Action Script 2.0. I would also like to have the circle graphic have a small photo pop up by it when the mouse hovers over it. What do I need to look into to make something like this happen? I haven't been able to find anything similar to doing this.

View 4 Replies

Button On Pressed Stage

Oct 13, 2010

I have 2buttons. Each have 3stages: up, over, down.I want to have 1st button to stay on its 'down state' when pressed and then you should see 2nd button 'up' stage(down stage of 1st button is the same as up stage in 2nd button).If someone hovered again you see 'over' stage of 2nd button,when will click, button move to 'up' stage of 1st button.

View 1 Replies

ActionScript 3.0 :: Make The Sprite Move After Another Key Has Been Pressed, Without Having To Up And Down The Key Again?

Nov 2, 2009

I can move my man with aswd and shoot moving balls with space, but there is an issue with it. When I'm moving my man by holding down a key, and then press space to shoot off a ball, then movement halts and you have to up and down the key again, to make the man continue to move.Here is the code:

Code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, moveMan);
function moveMan(e:KeyboardEvent):void

[code]....

As you might be able to see, I tried using another variable to store the old key code in, and switch it after the actions of a space press has occured.e how to make the sprite move after another key has been pressed, without having to up and down the key again?

View 7 Replies

ActionScript 1/2 :: Make A Movieclip Play Only While A Key Is Pressed?

Mar 21, 2012

this is the code i am using, i get what flash is doing, after i release the key it starts to play the "walking" frames- only i include the gotoAndStop("idle") so it doesn't get to play "walking".but what i am looking for it to do is play the  walking only when the key is pressed and stop when released.

onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT))//68
{
this._x += moveSpeed;
this.legs.gotoAndPlay("walking");

[code]....

View 1 Replies

ActionScript 2.0 :: Motion Tween The Button To Return Up To Its Original Spot When Another Button Is Then Pressed?

May 26, 2005

I'm trying to create a set of 4 vertically arranged buttons that 'split' apart when those buttons are pressed. For example, if you click the topmost (1st) button, the bottom three buttons will drop down so submenus (for the 1st button) can now be revealed beneath. Again, when you click the 2nd button from the top, the bottom two buttons drop down, revealing submenus, and so on.

Now, is there a way that I can use actionscripting to tween the buttons to not only motion tween a drop down when a button is first pressed, but also to motion tween the button to return up to its original spot when another button is then pressed? Right now, I have two keyframes, side-by-side which each containing a different y-scale value for an object. Can I do some actionscripting to get the object to motion tween upward to its original spot instead of "clicking," or snapping back to is original spot when another button is pressed?

View 1 Replies

ActionScript 2.0 :: Snap - Press Button To Detect The Last Button Pressed And If The Shapes Match

Jan 12, 2009

I want the press button to detect the last button pressed and if the shapes match, make them do something...obviously. I think I'm going at it the wrong way. I need to stick a "triange" id into the button/mc then if compares that and then if there is a match works then... right?

[Code]...

View 1 Replies







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