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
Similar Posts:
Feb 26, 2010
This can't be too difficult but its killing me. I want my user to be able to type 3 numbers into 3 different input boxes, capture those numbers, calculate and display their average in a fourth text box.
I am not sure how to capture input from a textbox in AS3 in order to do these calculoatilo.
View 1 Replies
Jul 6, 2009
I'm using AS3 in timeline. I have a three page movieclip (dynamic_mc). Each page is labeled p1..p3. On p1 I have an input text box named userName and button named next_1. On p2 I have a dynamic text box named greetings_1, an input text field named schoolName and two buttons (back1 and next2).On p3 I have another dynamic text box named greetings_2 and two buttons (back_2 and next_3).
On p1 user enters name, which is captured on p2. Once a click next button on p1, I get this error:
TypeError: Error #1009: Cannot access a property or method of a null object reference. at FlashCS4_Curriculum_fla::lesson9_pg6_dynamic_122/frame10() at flash.display::MovieClip/gotoAndStop() at FlashCS4_Curriculum_fla::lesson9_pg6_dynamic_122/goP2()
Why do I get an error when using buttons? Is there a better way to capture input text?
Here is the code by page.
//page 1 = p1stop();
var hisName:String;
next_1.addEventListener(MouseEvent.CLICK, goP2);function goP2(evt:MouseEvent): void{ hisName =userName.text; gotoAndStop("p2");
} // page 2 =p2 greetings_1.text= "Welcome :" +hisName;var school:String;
//next buttonnext_2.addEventListener(MouseEvent.CLICK, goP3);
[Code] .....
View 5 Replies
Jul 27, 2010
I have a problem with the input text. I have a empty input text box on the frame one. Its name is "w". Then i m waiting for user input to that box. When the user input a text, i want him to click the button (called "manage_s") which will take him to the frame 2 and show the result of his input. (basically its quering the server).
[Code]...
View 9 Replies
Mar 30, 2010
I have a separate html page that does this with a php script,reating that php file which is just a form that allows users to enter a passcode that I provide them which will then simply link them to an external html page. Since I don't know about php, I am thinking a possible work around would be to have a text input box which would allow a user to enter (passwordA) then click Submit to load (pageX.hmtl) or they could enter (passwordB) and Submit would load (pageY.html)
View 13 Replies
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
May 15, 2009
I have a text box that i want people to enter a location into, and then when you press submit, a link takes you to [url]...
is this an easy script to do in actionscript 2.0?
View 1 Replies
Jun 6, 2010
I cannot get it to use my KeyboardEvent listener. I did find another post very similar however the fixes didn't work for me, or I am implementing them wrong. My code is as follows:
[Code]...
View 5 Replies
Oct 9, 2009
I am working on a site where you customize a postcard for print. The user adds images, text etc. I have run into a problem because I need to have the MC that contains all the images, text etc, captured and sent to me so I know exactly how to lay out the postcard for print.I can't for the life of me figure out how to go about doing this without the user having to "screengrab" or "printAsBitmap" and upload the resulting file.
View 3 Replies
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
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
Apr 8, 2012
For example, check out [URL] They enable their users to capture videos of themselves and then create animated gifs from them.
Just so this isn't construed as spam, I do not work for Gifyo. It's just an example.
Can this be done now with HTML5? Should I maybe us Javascript? Flash?
View 1 Replies
Jan 24, 2009
I created text field. Instance name of the text field is answer_txt01. When I enter the right answer "red", it should go to frame 2. However regardless of right or wrong answer, it goes to frame 3. How do I capture the user's answer on frame 3?
answer = answer_txt01.text;
answer_btn.onRelease = function() {
if (answer == "red") {
gotoAndPlay(2);
} else {
gotoAndPlay(3);
}}
View 9 Replies
Mar 2, 2009
what I'm trying to do is allow the user to pick a section of the stage, click, and have the region defined be copied and show up on the other side of the stage. It may be better explained to think of it like a camera game. The player has cross hairs, can move the square (which tracks the mouse) around the stage, and click to capture that square's pixel information, store it to a new movieclip and display it on another area of the stage.
I've found many resources online about capturing BitmapData, including capturing from embedded FLV videos, but I haven't seem to be able to find anyone who has created something like this which captures from a moving region. However, I have seen it done before in a game that is no longer online from PBSkids.org.
Here is what I have so far. Right now, when I click the movieclip loads all white pixel data and I'm not sure why.
[flash=]import flash.display.BitmapData;
import flash.geom.Rectangle;
import flash.geom.Point;
stop();
[Code].....
View 1 Replies
Dec 21, 2011
I am trying to capture the microphone and send the recording to my server.. I tried this method here but it records only a big WAV and the upload can be slow sometimes. Is there a way to capture the voice and compress it on the client side? Best method would be to send the recording while recording, but I have no Idea if this is possible. (It works for YouTube Live Webcam recording, it must work for Audio only too..)
View 1 Replies
Aug 13, 2010
When a user visits my page, they currently have to click inside a textfield within the movie to type in an ID number.How easy is it to make the movie 'live' so they don't have to click on the swf file itself Once this is sorted, I am ok with making the keyboard input populate my textfield as that already works, I am just trying to make the mouseclick on the movie non-existent. Apparently, ADA means they don't want the mouse click event to activate the movie.
View 1 Replies
Dec 31, 2010
i want to user print screen command in AS3 and convert into bitmap as background in fullscreen i.e.
print screen from keyboard - keycode i.e. 44 [URL]
i want to know how can i run printscreen code from flash to capture user screen as i want to have flash presentation in 600x600px with disabled desktop and flash presentation should be in center of screen.
Quote:
import flash.system.fscommand;
stage.showDefaultContextMenu = false;
stage.scaleMode = StageScaleMode.NO_SCALE;
fscommand("fullscreen", "true");
[Code].....
View 3 Replies
Oct 21, 2010
I am using flash to control a toy rc contro car via an arduino microcontroller. I have written the code for the basic direction controls (see below). I would like to add more funtionality though by recording keypress times and have the car run through a set of movements at the click of a button.
Code:
package
{
[code]........
View 1 Replies
Mar 14, 2010
I have 4 pictures on the stage each are buttons. I asking a question which there are 2 correct answers ie: 2 out of 4 buttons are correct. What is the best way to capture when the second correct button is clicked so that I can display a message saying move to the next activity! The code below just shows one of the correct buttons but doesn't seem to work at all. The error message points to the first line of code here; Syntax error, expecting idetifier before colon. I can send the fla file it helps?
var:lastBtnClicked:String = "";
E26_btn.addEventListener(MouseEvent.CLICK, displaytick2);
function displaytick2(e:MouseEvent):void {
if(lastBtnClicked == "E218"){
[Code]....
View 10 Replies
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
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
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
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
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
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
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
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
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
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
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