IDE :: Add Up All The Numbers Inputted Into The First Three Dynamic Fields?
Apr 23, 2009
I have four dynamic fields named
1. fieldone
2. fieldtwo
3. fieldthree
4. answer
and a submit buttonI would like to be able to add up all the numbers inputted into the first three dynamic fields by the end user and the result displayed on the 'answer" field.
i am having a problem restricting an input text im not sure if this has to be done in two ways or can be solved in one. what i want to do is only allow letters to be inputed which have not been inputted before and the empty box to be imputted i have tried
imput_txt.restrict = "a-z^Letters_str";
but this seems to only let me enter the letters except for LETRST ive tried putting the string outside the qutation marks and other variations i have also tried it with /'s around and before the string.
I have two input boxes that I can type numbers into.I'd like a third input box to display the total of the first two.I've set up a key pressed listener on the stage to run a function that adds them together when a key is pressed.Problem is, it just places the strings together - it ddoesn't add them.So how do I tell Flash that box1.text and box2.text are numbers?box3.text = box1.text + box2.text ain't doing it.
I'm making a sudoko solver, and i have 81 input fields. They're named from i11 to i99. The first number is the column number "x", the second number is the row number "y". I want to transfer those numbers out of the input fields, and into an array.
[Code]...
is something wrong with the way I am naming the grid array? After tracing just about everything, that must be the problem.
what I want after pressing the button (calculate_btn)is to get thees values entered from these input texts into 3 vaiables.
var $money var $percent var $years
and check if the inputs are numbers only not string not empty. I tried to convert the inputs to numbers to insure that they are numbers without making a function to check the inputs but always I get NaN when I entr value like 444bb;
ActionScript Code: error_txt.text = "Enter some values to calculate your loan"; //--------Make the button listener----------//[code].........
I can't get the code to "know" which of the dynamic thumbnails has been clicked (by "know", I mean return an index value, say 0 through 7 if there are 8 projects, that I can use to access that particular project in the array of 8 projects in the rest of the code)... So if the third movieclip thumbnail were clicked, I'd like "2" to come up somehow... I've tried this code, which is kind of lame, I know, based off of the idea of each of the thumbnail movieclips' names ending in their index number:
Code: //"this" is the button that was pressed; would return a string ending in //thumberMC_<number of whichever movieclip thumb was clicked> var: testString:String = this;
[code]....
Lastly, there's a dynamic textfield I'm trying to create that never shows up for some reason. Again, you could see in the FLA (in the "createDrawer" function around line 424).
I want to generate a mc for each rep with 6 text fields containg the 6 values for eash rep.So for this xml there would be 3 mc's with 6 text fields in each. This is one of my first times really diving in to xml parsing in Flash.
I am wondering how do we determine when a user "starts" entering text into a dynamic text field. Say a person has entered the wrong information and they get an error. I would like to be able to remove that error message as soon as the person selects the input fields again.
I'm trying to make this guessing game where you have to guess how many times a penguin will bounce off the water surface before it sinks The way I'm planning to do it is kind of like this:
1.[Script telling textbox to add +1] >> 2.[Bounce animation] >> 3.[Script that randomly sends you to point 1, or 4] >> 4.[Ending animation]
Yeah, and right now I'm desperately trying to get that dynamic text field to work ...I've made a button with this code:
(The textbox is called "test") on (release) { test ++; }
And on the first frame of the timeline I've added this:
I am working on a project where I am reading (trying to!) from an xml file. I have 5 separate dynamic text fields that I am filling with the individual digits from a string. I am not an expert but really think my code should work. Below is the actionscript and the xml I am using.
import fl.controls.*; var digit01_xml:XML; var xmlReq:URLRequest = new URLRequest("testRBS.xml"); var xmlLoader:URLLoader = new URLLoader();
What I'm doing is that I want to create textfields using flash and insert them into my HTML portfolio site.The reason I'm doing this is to be able to use special fonts, kern the text properly and customize the anti-aliasing. I tried with CSS but I don't have enough control using that (regarding kerning and anti-aliasing).I have created a Flash file that can load specific .txt files into the textfield of the SWF (so that the text becomes formatted), using FlashVars. I discovered that kerning in Flash doesn't apply to dynamic textfields unless you set it using actionscript. So I've tried to use the following code on my textfield:
--- var myFormat:TextFormat = new TextFormat(); myFormat.letterSpacing = 3;
I'm populating dynamic text fields within (timeline) animated movieclips. For some reason, this only works with the first movieclip even though the rest are formatted identically. I'm getting no errors.I can load other nodes into this MC so I think the XML and the code targeting the nodes seems fine (tracing the node values works as well).
The problem seems to be with the target movieclips, however I cannot find any differences in their settings compared to the one that is working. AS and XML below:
Code: function loadXML(loaded) { if (loaded) { var format1:TextFormat = new TextFormat(); format1.letterSpacing = -4;
[code]....
I have attached the FLA and XML for reference, version CS4.
i have my black berry being able to add a custom pin i created and when i send a message its shows on the screen but want i need help with is when more thane one persons use it when they text it removes the previous text so i need help in know how to create 4 dynamic text fields so when they text it can transfer to the other three and remove after a period of time..
I am having trouble embedding a font in my Flash file. I have the font in my library. I have the text field selected to that font with the * next to it. In my actions I have: vid_title_txt.embedFonts = true;
If I set it to false instead, it shows a different font. But if it is set to true, nothing shows.
Is there a way to type HTML directly into a TextField in Flash CS4? I've created a TextField on the stage, set it to dynamic, set "Render text as HTML" and thought that I could then type HTML directly into the TextField and that it would be rendered as such. Instead it displays whatever HTML I type as regular text.
I assume then that the only way to get HTML into one of these fields is to dynamically load it into the TextField through the htmlText property. Is this right? And if so, what exactly is the purpose of having a "Render text as HTML" button in the first place? Couldn't I just load the HTML into the TextField through the htmlText property anyways?
Well, at any rate, I was really hoping to use as much of the flash interface for the project I'm working on, such that anyone who didn't know AS3 could easily update it themselves. Now it's looking like not only will they have to know AS3 and HTML, but also have to deal with the hassle of formatting what will potentially be a complex system of images, textfields, and videos all in AS3 with no visual interface.
Is it too much to ask to be able to just highlight some text and make it bold or italic? That's really all I need, sadly.
I think that I have properly embedded the Verdana font (see image below). However, in my Flash game, dynamic text fields do not show certain letters, such as X and J. What am I missing?
I'm having trouble with dynamic text. I have a symbol with dynamic text fields in it. In the action script file I want to change the text of these text fields like this: textFieldName.text = "new text"; But nothing happens. I cannot see any text when I play the movie. Also I tried adding a dynamic text field directly to stage and change the text with textFieldName.text = "new text"; I can see the new text when I play the movie. Then I added my symbol that has the dynamic texts in it, and the text of the text field that is directly on stage disappears. When I delete my symbol, the text is back there. I'm using Flash CS5 and ActionScript 3.0.
i need to use large list of locations in text field round about 5000 to 6000. i have done that but the text field doesnt display data when reaches more than 3000 i think (below it its working fine), i need to cater this prob, maybe it can be done through paging
trying to format some dynamic text fields (i.e.) Im trying to specify the font style, the font size and colour, but my code below doesnt seem to be working, no errors being returned.
ActionScript Code: private var fontStyle:TextFormat; fontStyle = new TextFormat("Arial",18,0x006666,false,true);
2. Also trying to specify the physical size of the dynamic text field via code, so that long sentences for example can be fully seen without being cut off, see image below.But Im unsure on how to work out the code for doing this tried the regular googling tatic but no results. my dynamic text fields are added to the stage via addChild(); so just physically changing the size of them on the stage .FLA isnt an option as they arent actually on the stage.
I'm making a program so that you can plug in your birth year and get some basic information on what Chinese year you were born in (Year of the Dragon etc).I created a class, linked it to an MC and looks like it is creating everything okay but the input text is definitely buggy.I can input text at the top of the stage but not in the actual text field.I have spent a lot of time on this and am completely clueless as to what is bugging this thing out.I guess I am not declaring something properly but I've had my TA take a look at it as well and she cannot figure it out. [code]
I'm using XML to load text in dynamic textfields but want to attach a button to every field with a different link. How to position these buttons exactly behind the text fields and give them getURLs? I'm attaching the fla & here is the xml:
create superscipt number, or to hack it in dynamic text fields? I'm using XML along w/ a number of CSS styles and I can't find a way to achieve this. One option would be a nice small pixel font thats designed to looked like superscript numerals.
So I have a project where there are 5 dynamic text fields, and I thought it would be quite simple. Create a dynamic text field, and then load in the .xml content, and I had it complete. However, it turns out that spacing is quite important, so my method will not work, and I'm kind of stumped how to proceed.So the things highlighted in red represent the .xml nodes, and as the width (character count) of TEAM1 and TEAM2 change, the spacing needs to remain consistant, and the static elements (the "vs." and "|" need to move accordingly, and the TEAMLOCATIONS need to stay lined up as well..Does anyone have a good idea how to handle this, or a good tutorial they could point out? I'm trying to build my own array structure, and calculate the width of "TEAM1", but it's slow going..
I am pulling my hair out trying to find out why this isn't working. Is there anyone out there that can help me out? I'm trying to get the dynamic text fields to display the numbers I have set in variables but the dynamic text field will not display anything, even if I put numbers in there, I have checked my syntax and it is correct, I have made sure that bold is not checked and I have made sure that my fonts are embedded but this thing still will not display.
I've got a bit of a problem with dynamically created text fields. I want to have the required effect :
The flash file loads the xml file (this works fine) and is able to read all nodes and attributes (yup, works too) and then create a certain amount of dynamic text fields populated with data from an attribute(not working so well....) Heres my code :
Code: var news = new XML(); news.ignoreWhite = true; news.load("newsdata.xml");
I'm loading XML into dynamically created text fields. I've got everything working properly in that aspect. Now, for example, the XML has 5 different events, each with a "name", "city" & "date". I can get the first event to display all the variables. How do I get Flash to continue to output the rest of the XML file into text fields without creating dynamic fields for every XML node?
Code: //Create XML loader and load it var eventsXML:XML; var xmlReq:URLRequest = new URLRequest("xml/test.xml");
I have a series of dynamically created text fields that form a grid and I want people to be able to auto tab through each field in the grid. I want them to be able to enter in 1 character and then have the focus move to the next field in the grid.All of the TextFields are named "inputBox" with an ID number added to the end using the name property of the TextField class. So they are named as follows inputBox0, inputBox1, inputBox2, etc.Now for the code I am using to change focus to the next textfield:
stage.addEventListener(KeyBoardEvent.KEY_UP, checkTextField); function checkTextField(e:KeyboardEvent):void{ var instanceName = e.target.name;