ActionScript 3.0 :: Get Text To Concatenate Properly?
Nov 25, 2008
When I use the code below the "!" never appears in the output text field. I tried removing nameInput.text and then the "!" will appear. But with nameInput.text in the code, any string I try to add after it does not appear.
I have a submit button that I'm pulling in from XML.It needs to be XML because it is translated.Therefore... the length is varying depending on the language.I simply want to add an arrow to the end of the word using Webdings #4 (it looks like a solid arrow, not like > but solid)...
i am working in a flex application, i have an mx text control or I can use whatever control I need to do display the text value, but what I am trying to accomplish is to be able to format that text value with html 'before' it gets bound to the text control.<mx:Text text="{data.combinedCriteria}" width="99%">In the .as file that manipulates the combinedCriteria property of data,
How can I prevent concatenating when using the addition operator? totalCost_txt.text = (firstCost_txt.text + secondCost_txt.text)I can replace the "+" with any other operator and it works. (huh?)
I'm trying to make a function which ideally you tell it to go to the next level and it sorts everything out to transition to the next level for you. Currently I use this to get from level 1 to 2...
[Code]....
Also I need to make it so it checks if levelText == whatever on press of the Enter key, as well as the mouse click on GoButton.
I'm starting out with AS3 and migrating some old code. I have several dynamic variables in AS2 but they are using _root which isnt available in AS3.How would I go about switching the following variable to AS3? I have at least a dozen different variables similar to this one.
Code: for (i = 0; i < (k-1); i++) { pivot = _root["AI"+i][i][i]; // existing AS2 code
I have this code to push "Variable1" in to MyArray: ActionScript Code: _root.MyArray.push(Variable1); Note: "Variable1" is a number stored as a string. When "Variable1" changes, the code above is called upon to add the new "Variable1" value in to MyArray. Then I have this code which is called upon to find the sum of all the values within "MyArray":
My problem is that rather than adding the values contained within MyArray (as if they were numbers), the values are being concatenated instead.
Example: If MyArray values were 1, 2, 3 I want the MyArray_Total to = 5 But instead... MyArray_Total = 123
I tried making a new variable named "Variable1_num", declaring it as a number, making it equal to "Variable1", and then pushing "Variable1_num" in to "MyArray"... but that didnt seem to work either.
I'm trying to concatenate a name and variable number. Then trace it, so answer3 should output from my loaded xml data "water". Instead all I can get to trace is the word "answer3". If I type "answer3" in the trace I get the variable im looking for. If I type [this.getCorrectAnswerNumber()] in the trace I get number 3. How do I go about concatinating the word answer and a dynamic number.
It is possible to reference an array inside of an image file name, here's the scenario.
I have a list of images that only differ by the number at the end of the name (for example. orangeimg1.jpg, appleimg2.jpg, strawberryim3.jpg, etc. Is it possible when referencing the image that I could somehow reference the array in the file name rather than repeating the same code over and over again?
I have two different arrays set up one for fruit which has (orange, apple, stawberry) and I have another array with the numbers (1, 2, 3). I have jpg images for each of these combinations but how to I reference that in one line when I'm trying to refer to these images. I thought something like source = "[fruit].img.[number].jpg" would work
Again I've found some information on the web but it doesn't refer to how it would work if I was coding a source for my images.
The course contain ten chapters that all have to report that when a user completed them. When they all are, the status is set to "completed" for the course. First off the theory behind it:
1. I just completed a chapter.
2. Load a string with then numbers "0,0,0,0,0,0,0,0,0,0", one for each chapter. All 0's, no chapter is completed, all 1's, all chapters are completed, you get the picture.
3. Add a 1 for, lets say chapter 5, would look like this "0,0,0,0,1,0,0,0,0,0".
4. Check if the course is complete, like this: "1,1,1,1,1,1,1,1,1,1", or not.
5. If complete, set status to "complete", if not, set to "incomplete".
In practice:
import flash.external,*; String(ExternalInterface.call("LMSGetValue, "cmi.suspend_data, TheCourseStatus")); String(ExternalInterface.call("LMSSetValue, //..add the number "1" to
[code]....
So, after this rant. How do I,
1. Get the string.
2. Add the course number/value to the string
3. Then update the string, and..
4. ..set the appropriate status.
I found out that "I need to concatenate them together with a delimiter so I can separate the string on re-entry", but I don't know how to do that.
var c = mainSubThumbs.SubThumbsHolder[materialType].subthumb_mc[id] what i have obviously doesnt work. materialType and id are my variables that I want to be added onto these mc instances..
This one is really strange. The last letter of all my text in the actions window gets cut-off by the next letter (or space) and it is making my script very difficult to read.
Just trying to get the text from my InputText TextArea component to append to my Dynamic text field DisplayText when I press enter. I'm getting weird skewed results.
I'm relatively new to Flash, and I�m in the process of creating a flash intro to my website. The problem is, whenever I preview one of my Mask layers by pressing Ctrl+Enter, the mask effect doesn�t work � it merely shows the masking object. The puzzling thing for me, which leads me to suggest that the mask should work is that in the normal timeline view, when I lock both the mask and masked layers and press Enter or slide through the frames � the effect works perfectly. On Ctrl+Enter all of my other Masks work fine as well - the one in question has text as the mask content.
It only stops working when I view it as an .swf file or play the movie with Ctrl+Enter. Does anyone know why this is happening, how I can get around it, or whether it will be a problem when published?
I've loaded and parsed some xhtml in my DataManager class that is validated against the W3C strict dtd.I'm pushing certian bits of this into public arrays in my DataManager. My ContentManager, calls to the DataManager, and is returned a corresponding data set ,instantiates a new GenericSection , and passes in the array as an argument in the constructor.[code]...
I am trying to apply a new text format to my text field on a movie clip onRollOver. The new text format is properly/correctly applied when I moused over, and the main difference that is applied onRollOver is to have the text underlined. The only problem I'm having with this is that the actual underline itself appears to be about two pixels to the left of my text string so it looks like its not aligned properly with the text.[CODE]...
My prblem is I have a node that doesnt always have something in it. It is used for url's so i put an if statement but it still puts a message even if its blank. here are my codes to explain better:
I'm using as2 to place a text field with embedded fonts, whose content is coming in from xml inside of a cdata tag.When I publish the movie, all is well.When I upload the movie online, the commas in the text field appear backwards and the emdash is missing.The fonts otherwise appear to be embedded properly - it's displaying with the fonts I intended it to.Not sure why just these characters are changing online, but appear properly in the flash environment when I publish the movie?
In an attempt to use a dynamic text field on my page, and passing text to it such as..
question.text = "Sample text here"
..where the instance name of the dynamic text field is "question" ..I found that if I add another text box to the page as static text, but using the same font as the dynamic field, the dynamic field populates incorrectly.If I compile using CS4 it works fine, and if I break apart the static text in CS5 it works fine.I also found if I change the font of the static field to something other than that of the dynamic.. it works fine.However in further testing..if I place a second static text field on the page,the dynamic again breaks even if I use the different font as before.
All of these scenarios work fine in CS4, but in CS5 is causing my dynamic field to change to the same as my static text, or simply mixing letters and otherwise not displaying my dynamic text...I've tested on three systems here all with CS5 ...
I have a button that when clicked it displays a few lines of text. Some of the text is large, bold and some of it is normal and smaller size. The first time I click the button the text displays properly but if I click on it a second time then the text is messed up. I am new to flash and have tried several different things.
as you see in the swf you first have to switch with "aankomende optredens" en "gespeelde optredens" before you can read the aankomende optredens text... why? i just want it to load immediately, so you can read it... without having to read "undefined"
I have a form, with input text fields, and static text labels between each...
like this
(static) name (input) name (static) email (input) email
[code]....
then a submit button. on the right hand side of all of these fields.It seems that when I press tab, instead of cycling from one input text field to the next, and then ending with the highlight on the submit button, it keeps tabing up to the "Address" line of my browser.I'd rather it tabed through each of the text fields.
Code: optredens = new LoadVars(); optredens.load("optredens.txt"); optredens.onLoad = function(){
[code]...
as you see in the swf you first have to switch with "aankomende optredens" en "gespeelde optredens" before you can read the aankomende optredens text... why? i just want it to load immediately, so you can read it... without having to read "undefined"...
I'm trying to update my text area via ActionScript code using this: scoreLabel.text = this.score.toString(); but it's not behaving correctly. When the score is 18, the text area displays just 1, when it's 26 it won't display anything at all... As a test, I tried doing this: scoreLabel.text = "this is a test"; and now the text area is just displaying e: [URL] This isn't a font issue, as I'm using Arial. What is going on here?