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


Similar Posts:


ActionScript 3.0 :: How To Wait For User Input

May 1, 2011

Is there a way in as3 to pause the execution and wait for user input (click on yes or no for example)?[code]

View 6 Replies

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

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 :: Flex - Wait Until User Respond And Then Continue Process?

Mar 8, 2009

If I have code:

Code:
Alert.show('Please respond');
request.send();

In this code, flex will pop alert to screen and immediately send out the request. How do I wait until user clicks ok on the alert and then send out the request?

View 1 Replies

ActionScript 2.0 :: Is There User Input Text Box For User To Type In A Box From A Keyboard

Apr 17, 2011

is it possible in actionscript for the user to type in a box from a keyboard like a user input text box..

View 3 Replies

Actionscript 3 :: Placing Cursor Into Input Textfield For User Input?

Dec 15, 2009

What easiest way to place cursor (focus?) into an textfield input box for receiving user input after an event?

View 1 Replies

ActionScript 3.0 :: User Input Textfield - Get The Information The User Put In The Box?

Feb 25, 2009

I have some text that says go to page with a input textfield box and a go button. This is a flash cs4 file.I want to have the user input the page number and have it go to that frame.I am using actionscript 3.0 and have bought 4 books and researched online and still can't find what I am looking for.I can make the go button go to whatever page I want I just don't know how to get the information the user put in the box.

View 2 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

ActionScript 3.0 :: Wait For The User To Save A File (xml / Datagrid / File Saving)

Dec 11, 2009

step1- I got an xml that is locally loaded(works fine)
step2- the content goes into a datagrid that is displayed (works fine)
step3- In AS3 I dynamically add some lines to this xml file(works fine)
step4- I save it locally (works fine)
step5-and want the datagrid to be updated..(works not-so-well)

So, in step 4, the data is saved into the xml file, but in order to finish the save, the user has to click on the "Save as" windows in order to have the file updated of course.. and that's where's my problem, how can i tell flash to wait till the user actually saves the file, before reload the xml file in the datagrid ? here's the code :

[Code]....

View 3 Replies

ActionScript 3.0 :: Keyboard Input Pause?

Jan 20, 2009

I want the user to be able to press and hold the arrow keysto move an object around the stage. When the button is pressed, theobject moves once, pauses for a second, and then continues moving.How do I get rid of this pause?Here's part of the code I used:

stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
function keyPressed(evt:KeyboardEvent):void
{

[code]......

View 3 Replies

ActionScript 3.0 :: Remove Keyboard Down Input Pause?

Sep 30, 2009

I know i've seen something about this before many times on the web, but i just cant seem to find it right now when i need it.[code]...

What is the code that will make it so there is no pause and it continuously spams the hello from the second the key is pressed until it is up?

View 6 Replies

ActionScript 2.0 :: Pause Moving MovieClip Without User Control?

Mar 30, 2006

I have a mc on the stage - a strand of photos moving from left to right, like a filmstrip. I need each photo to come to center and pause for, say 7-10 seconds (no user control). I can get the filmstrip to move left to right (but only once and only controlling the time from start to end)... But can I script it such that the clip will pause where I want it to and for however long I need it to? And then move again from the new point, to the next new point? I'm having no luck. I could motion tween, but want to keep it more compact (and more simple)... I'm working in flash 8 but publishing for 5...

View 1 Replies

ActionScript 3.0 :: Interactive Video/ Auto Pause/ User Play?

Oct 18, 2009

I have an animation that's heavy and needs to go into the flvPlayback component. It needs to pause automatically and call a sound effect that repeats until the user clicks the play button which is a movie clip that appears via addChild(). It's being loaded by an external swf currently. It works now, just takes a while to load.\

View 0 Replies

ActionScript 3.0 :: URL Request From User Input?

Nov 28, 2010

I am trying to make a generic multiple choice quiz, with questions to be loaded from an xml file. The hope is that I can give it to teaching colleagues as a resource, and they can create their own questions by just altering the xml file, as none of them know how to use flash. I can make all of it work beautifully for just one xml file's worth of questions, but I'd like to enable people to save several different xml files with different questions, and choose which one to use in the first frame of my swf. Here's what I have in the first frame, where there is simply a text input box (inputxml) and a 'Go' button.

Actionscript Code:
stop ();Go.addEventListener(MouseEvent.CLICK, fl_ClickToGoToNextFrame);var chosenFile:Stringfunction fl_ClickToGoToNextFrame(event:MouseEvent):void{Go.removeEventListener(MouseEvent.CLICK, fl_ClickToGoToNextFrame); 
chosenFile = inputxml.text;
nextFrame();}
[Code] .....

I have just changed over from Flash Pro 8 to CS5, and AS3 is still a bit new to me - am I doing something really daft?

View 2 Replies

ActionScript 2.0 :: Getting Variables From User Input?

Oct 11, 2004

I'm creating a simple flash movie that will allow me to setup an aim away message from the desktop or merely a web page, the code used is as follows:

aim:goaway?message=Message+Here+Go+to+aimisland.co m

s you can see there is a + after every word and the text is after Message+. I need to know how to get text which is entered into a text box to be inserted into the above code to complete the link.

View 3 Replies

ActionScript 2.0 :: Variables From User Input

Oct 11, 2004

I'm creating a simple flash movie that will allow me to setup an aim away message from the desktop or merely a web page, the code used is as follows:url... As you can see there is a + after every word and the text is after Message+.I need to know how to get text which is entered into a text box to be inserted into the above code to complete the link.

View 3 Replies

ActionScript 2.0 :: Tell If User Is Typing Into A Input Text Box?

Jan 17, 2009

I'm wondering if there is a way I can see if a user is typing into a input field.

Like if they are typing into the field a variable = 1

And if they are not or the field is empty it is = 0

View 1 Replies

ActionScript 3.0 :: Capture User Input When Hit The Next Button?

Mar 17, 2011

I am creating a game that has a gender selection and name entry box on a screen. When users hit the next button, I want to capture which gender they selected and what they typed for their name. I tried using the code found on the adobe website, but that captures every letter typed in real time.

I just started learning actionscript this week, so I'm a noob at it. Currently, when they click on the button boy1 it erases whatevers in the dynamic text box playeronesex and adds the word "woman". When they click the button girl1, it erases whatevers in playeronesex and adds the text "woman". I also need to know how to capture which they finally chose when they hit the next button.

Heres the actionscript for this frame:

//next button
stop();
onbone.addEventListener(MouseEvent.MOUSE_DOWN, nextone);
function nextone(event:MouseEvent):void {

[Code]....

View 2 Replies

Data Integration :: Saving User Input To Xml

May 22, 2007

I'm sorry this is a question from a server ignoramus, I've previously captured user input using a combination of cfml and text files. That was way back in 2002 and using AS 1.0. I'm now working in an environment where the server guy won't put any scripts on, and I mean none, no PHP, no ASP, no CFML, nothing. Would anyone know if there is a way of capturing user input without using a script, please? This prolly shows a really basic lack of understanding of how servers work but I'm a bit desperate. I know the Flash Learning Interactions can work with SCORM and pop results into LMSs that use SCORM and our LMS does use SCORM, but it seems to only be within the learning interactions and I don't know where to start to tailor this for the input I need to capture.

View 2 Replies

ActionScript 3.0 :: Playing Sound According To User Input

Jul 5, 2010

I want to stop the sound according to user input. For example if an user enters in a Textfield 4.32 seconds, I want to pause the song exactly at 4.32 seconds ( 432000 milliseconds.) I created a timer handler, which will fire every 1 millisecond and traced the soundChannel.position property. The last 2 sound position is
4318.911564625851 ( 4.31 seconds );
4365.351473922902 (4.36 seconds);
But how to stop at 4.32 seconds for the user?

View 1 Replies

ActionScript 3.0 :: Countdown Timer With User Input?

Dec 28, 2010

Right now I have a countdown going on, but with a fixed date.  How would I go about doing this with a user input?...what I would like to do is the user enter a specific date and the countdown to begin.

View 1 Replies

Professional :: User Input To Control Animations?

Oct 25, 2011

I have an idea for a simple game/program and not sure if Flash is the way to go.After reading many articles I've come to the conclusion that if I wanna make my idea a reality then I need to do it myself but not sure where to start.Before spending the money on buying cs 5.5 want to make sure it can do what I need.So my question is can you have users input data that would then control your animations? 
For a simple example:I want a user to be able to input a number then depending on the number a certain animation sequence would occur.So say a user inputs the number 10 then my animation would walk over to a pile of say apples and pick up 10 apples.  If they input 5 the animation would pick up 5 apples etc...So my idea has nothing to do with apples but revolves around the user inputting numerical data which would then control what the animations do. 

View 3 Replies

C# :: 3D View Of The Input Which The User Can Move The Camera

Feb 17, 2010

A friend of mine asked for a simple program. Input: Coordinates of some points, spheres, planes etc. (from an excel document (strictly) ) Output: A 3D view of the input which the user can move the camera. The questions is, how can I do that easiest way. I have experience in C++, C#, Flash (AS), Java

View 2 Replies

ActionScript 3.0 :: User Input Added To An Array?

Nov 12, 2009

Ok I have 6 textboxes that the users will use to type in 6 different numbers from 1-49. What code would I need to add so that once the user has entered their 6 numbers, they are sent to and stored in an array?

View 2 Replies

ActionScript 3.0 :: Capturing Data From User Input?

Jan 23, 2011

I'm sure it's easy to do, but I just cannot figure it out. I've created a timer but want to let the user set default values to start at so they don't have to modify the start time each time the program starts.I was able to create a text box but it is un-editable in the actual program. It displays '00' nicely but it's useless. I haven't even gotten to the point where the data is pulled and stored.

ActionScript Code:
var timerHrs1:TextField = new TextField();
timerHrs1.type = TextFieldType.INPUT;

[code]......

View 3 Replies

ActionScript 3.0 :: Displaying User Input In Welcome Message

Feb 8, 2009

The goal is to have the user enter their name in the input text box and then click start. When they click start a ball starts rolling and a welcome message should display "Welcome + name". At first the ball is rolling fine and the name is displayed - but after about 3 seconds the frames sort of flip and "Welcome name" turns into just "Welcome" (name dissapears)

I'm sure it's something really dumb but my eyes are crossing.
- layer 1 is my circle image (myCircle)
- layer 2 is my button (startButton)
- layer 3 is the input field (inputName) and the dynamic field (displayName)

Here's the code:
stop();
var inputName:TextField = new TextField();
inputName.type = TextFieldType.INPUT;
inputName.x=200;
inputName.y=100;
inputName.width=150;
inputName.height=20;
inputName.border = true;
addChild(inputName);
[Code] .....

View 1 Replies

Load User Input Text In Flash

Jun 6, 2010

I am using Macromedia Flash MX 2004, and I am trying to make a flash video file where a user can input text (I got that to work properly).

And where the user-input-text is used later on in the flash movie,

I am looking for actionscript and beginner help for this to work, I'm not new to flash or to actionscript, but I'm still a newb.[url]...

View 3 Replies

ActionScript 2.0 :: User Input Text Fields

Oct 14, 2003

I was wondering if anyone could please send me info user input text fields. I was wanting to set up a section in my flash site where the user

a) types in their name in first field
b) second field they type in their email address
c) third field they type in their email message and then hit a submitt button to make their message reach me!

View 5 Replies







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