Wait/Pause Untill A Key Is Pressed?

Oct 21, 2009

Im trying to make some sort of hearing check to see if your ears are still functioning the way they should be. In my program the user is shown 9 images (for example an image of a cat) The images correspond to the 1 - 9 keys. (Im not sure if this is relevant but i'm programming for a Flash Lite application to be run on a mobile device)So let's say the image of the cat is number 1. The sound of the cat is being played and the user has to press the 1 key on his keyboard. However for this to be possible the script must pause and give the user the oppertunity to press the correct key.How can i make sure the script does not continue until a key is pressed after playing a sound.Below is my code so far:

Code:
stop();
var pressedKey = new Number();

[code].....

View 1 Replies


Similar Posts:


Pause And Wait For User Input?

Jul 8, 2009

I'm writing a movie scene in AS3, and I hit a snag. I have a movie where the dialogue is advanced by the user pressing a button (the space bar). I have a speak function which prints out the dialogue to a dynamic text box. However, if I type in this:

speak(1, "Hello world!");
speak(2, "Hello back to you as well.");

Then, my first speak function is immediately overwritten by my second one...because they run at the same time. I'm not using the timeline so, I can't put a stop() function in or anything. I'm doing it all in ActionScript.

Is there a way to pause the movie and wait for the user to press the spacebar before loading up the second function. I was thinking of nesting functions to do it, but that seems overly complicated since I'll have nearly 20 lines of dialogue nested within one another in between moving my sprites around.

View 3 Replies

ActionScript 2.0 :: How To Override Wait Function With Pause Button

Aug 24, 2004

I'm using this function
function wait(mc, n) {
mc.stop();
var myInterval = setInterval(function () {
mc.play();
clearInterval(myInterval);
}, 3 * 1000);
} _root.wait(this, n)

To delay events along my timeline. That code works fine. My problem is that is that I also want the user to be able to pause the movie at any time. However, if the pause button I'm using is pressed by the user while the timeline is delayed using this function it starts playing again after the interval even if the pause button is still pressed. How can I override this wait function with a pause button?

View 5 Replies

ActionScript 2.0 :: Can't Seem To Find A Pause/wait/delay Function?

Jul 6, 2005

I just want to have my code wait a couple seconds to let some scripted animation finish then load a movie into a holder but I can't seem to find a pause/wait/delay function is there one and how would I use it or can someone tell me how to do it somehow thats not too processor intense if at all possible.

View 6 Replies

ActionScript 3.0 :: Find Flv Player Pause Button Pressed Event?

Sep 28, 2009

i want to check a boolean value whenever pressed pause button in flv player.Any Event for play/pause button pressed like

_mc.addEventListener(MouseEvent.CLICK,pressed) ?

View 3 Replies

ActionScript 1/2 :: Make Audio Play And Pause / Stop When Different Buttons Pressed?

Jun 12, 2010

I am making a simple radio interface and i have 6 preset buttons which i want to have play the specific preset button's song which is in the library and stop/pause the current song when any preset button is pressed.

i tried using the attachSound function, with associated identifiers but not sure if that is the right way to go. It plays the songs, but doesnt stop them.[code]...

View 12 Replies

ActionScript 3.0 :: "Pause" Code Execution, And Wait For Result?

Apr 17, 2009

Visual Studio had a command "showDialog()" which allowed you to show your form as a dialog box on the screen. The advantage to this was that the code calling the dialog box would pause, stopping execution entirely until the dialog box closed. The benefit was you could write your code as follows (made "actionscriptey"):

Code:
var result:DialogResult = form1.showDialog();
if (result == DialogResult.OK)

[code].....

View 1 Replies

Pause Menu Activated When "p" Is Pressed?

Jun 22, 2010

ok, so i know there's a Key.isDown() function, but i need a key is pressed function,i simply don't know the function name, i've tried Key.is Hit (not cussing here, but without the space) and Key.isPressed.i've done some research and the closest i've seen is key.isToggled, but that only works with caps and num lock. the reason i need this is for a simple pause menu activated when "p" is pressed.

View 1 Replies

ActionScript 2.0 :: Preloader Which Is Not Appear Untill Fully Loaded?

May 20, 2010

i making flash website and i tried to put a preloader but it dosen't work ... if u wana see the example of what am talking about plz visit thisi spent alot of time and i visited all the threads posted here but i failed

View 1 Replies

ActionScript 2.0 :: Load LINK2 Untill It Gets To The Mid Frame Of 130?

Jul 11, 2008

ok so i have this

[code]...

so everything works well to be honest.. i followed the tutorial from kirupa BUT heres the thing i now made my movies about 150frames long. and i click on LINK1.. the mid frame is at 130. It will not load LINK2 untill it gets to the mid frame of 130. How and what do i set up, so it goes straight to the midframe>>exit. last frame (exit).. is this _root.container.loadMovie(_root.currMovie+".swf");

View 1 Replies

ActionScript 2.0 :: [MX04] - Hiding The Scrollbar Untill Needed?

Jul 31, 2004

I have a dynamic text field that loads text from an external .txt file. I have attached the scrollbar component to that text field. Is there a way to hide the scrollbar untill the text is overflowing and the scrollbar is needed?This is a Flash UI Component Set 2 scrollbar and I am exporting in AS1.0.

View 3 Replies

ActionScript 2.0 :: Pre Loader Doesnt Display Untill 60% Loaded

Mar 13, 2008

my preloader doesn't display until about 60% loaded?

stop();
textVar = "..::LOADING::..";
loaderInt = setInterval (Lbar,10) ;
function Lbar () {

[Code].....

View 2 Replies

ActionScript 2.0 :: [MX04]- Hiding The Scrollbar Untill Needed?

Jul 31, 2004

I have a dynamic text field that loads text from an external .txt file. I have attached the scrollbar component to that text field. Is there a way to hide the scrollbar untill the text is overflowing and the scrollbar is needed?This is a Flash UI Component Set 2 scrollbar and I am exporting in AS1.0.

View 3 Replies

ActionScript 3.0 :: Make It Fly From Left To Right Again And Again Untill The User Finish The Game?

Nov 24, 2010

I have a jet_mc object flying from left to right, i got that part ok but my question is how can make it fly from left to right again and again untill the user finish the game. what line of code should i add to make it loop.stage.addEventListener(Event.ENTER_FRAME,run)function run (e:Event){ jet_mc.x-=5}

View 4 Replies

ActionScript 3.0 :: Can't Delay Execution Untill Creation Of A New Class Is Complete?

Jun 17, 2011

although I do come from a OOP background. I have been asked to trial Flash and Actionscript 3 in particular - so I do come with a few preconceptions on how I expect actionscript to behave and I'm getting the impression that this is causing me problems.One issue I have is when I create a new instance of the class and assign it to a variable, subsequent background changes to that instance of the class are not 'picked-up' when referenced through the variable. I would expect that given instance of class could be assigned to many different variables and any background updates using one variable would accessible using any of the other variables. This doesn't seem to be the case.I have a test class, XMLDataLoader, which is coded as follows:

package {
public class XMLDataLoader {
import flash.events.*;

[code]......

View 9 Replies

ActionScript 2.0 :: While Mouse RollOver - Function To Be Exicuted Untill It Is False?

Aug 27, 2004

while the mouse is over my button I want a function to be exicuted untill it is false. how can i do this?

View 2 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 :: Create A Pause Button That Will Pause Everything On The Screen Including Movieclips/audio?

Mar 26, 2007

I am trying to create a pause button that will pause everything on the screen including movieclips/audio. Right now I can't figure out how to pause the movieclips.

View 2 Replies

ActionScript 3.0 :: Cs3 Pause Timer - Pause Each Time In The Last Frame For 8 Seconds And Loop Only 3x

Aug 2, 2009

I have some banners I am doing right now and have a pause timer question. I am fairly green at coding. In my first frame I have this:

[Code]...

I want it to pause each time in the last frame for 8 seconds and loop only 3x. Is there a better way to write this? I know all my code should be in the first frame but I still suck.

View 2 Replies

ActionScript 2.0 :: Adding Pause - Add A 7 Second Pause Between Each Phrase To Give People Time To Read Them (no Buttons)

Nov 25, 2006

I am using Macromedia Flash Pro 8. I have a flash intro that has words (phrases) which slide in. I would like to add a 7 second pause between each phrase to give people time to read them (no buttons). Could someone tell me the script(s) to use with all functions, etc. included - as I am so new to all this. I have been looking for weeks & tried many codes but none seem to work - or I don't know exactly where to place them - or both

View 3 Replies

ActionScript 3.0 :: Flash - Add A Play/pause Btn That Will Pause Both Pictures And Sound?

Dec 16, 2010

I have a timeline of 30 frames, each it's own mc (page01_mc, etc.). In each mc I show a picture or two and hear narration.I have a first, prev and next nav on the main timeline. I need to add a play/pause btn that will pause both pictures and sound. I assume I do that in each mc, but do not know where to find the code.Here is what is in each mc now:

var mySound:Sound = new Sound();
mySound.load(new URLRequest("english/Intro01.mp3"));
mySound.play()

View 1 Replies

Actionscript :: Wait For 3 Seconds?

Nov 8, 2011

Is there any way to implement waiting for, say, 3 seconds in ActionScript, but to stay within same function? I have looked setInterval, setTimeOut and similar functions, but what I really need is this:

[Code]...

In case you wonder why I need this - it is a legal requirement, and no, I can't change it.

View 4 Replies

ActionScript 2.0 :: Add A Simple Wait?

Dec 2, 2011

I have some code that loops an animation, basically I just want to add a few seconds wait before it starts again. The code is below, including the wait() function I am trying to use.[code]....

View 5 Replies

ActionScript 2.0 :: F5 - How To Tell MovieClip To Wait

Nov 6, 2003

Is there a way to tell a movie clip to way a number of frames from a specific action being executed (say a button being pushed) before it starts playing?

View 2 Replies

ActionScript 2.0 :: Wait A Few Seconds Before Doing Something

Mar 29, 2009

I'm New to flash and I can't seem to figure this out, I just want to make something visible for 5 seconds then make it invisible again.

[Code]...

View 1 Replies

IDE :: Wait Until Frame Is Loaded?

Feb 16, 2010

I have a textarea named "debug" on frame 2 that does not exist on frame 1Using this code:

Code:
function outputHello(){
debug.text="Hello";

[code].....

View 1 Replies

ActionScript 2.0 :: How To Wait X Seconds

Oct 29, 2004

i want to have some action script code like:

//some code here
//wait so many seconds(or milliseconds)
//then do so more code here

[code].....

View 1 Replies

Button Wait For Some Seconds Then Fade In

Apr 15, 2010

Is it possible in AS3, to have 0 alpha for some seconds, then have the buttons fade in... and I say buttons, as I have two of them. But wanted to finish it all of with a nice fade-in effect on my buttons. I've found some nice fade out effects with tweening in AS3, but I need fade in - and would like for me to decide when they should do this. So far I'm pretty satisfied with my first flash file, but I do like perfection!

View 2 Replies

Professional :: Wait Until SWF Completely Loaded

Jan 10, 2010

I am trying to load several swf files into various containers. In one scene I have used the following:
createEmptyMovieClip("container1", 1);loadMovie("MC.swf", "container1");

And I want to wait for it to load complete before moving to the next scene and doing the following one...
createEmptyMovieClip("container2", 2);loadMovie("MC2.swf", "container2");

View 3 Replies







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