Im creating a scoreboard within flash, ive got mysql data converted to xml and grabbed into flash, im trying to output the data: user, score, time into dynamic textboxs but can only get one record.If there is a better way, such as creating the textfields on output could someone point me in the right direction!
function outputXML() { for (var i=0; i<xmldata.item.length(); i++)
Is there any way to set a listener when a dynamic textboxs' text is changed via: textbox_txt.text ?
I have a class for my custom buttons and I would like to add this listener to check the size of the textbox and resize accordingly when the text is changed.
I realise that the best method would be to have a function in the class that changes the text and does the check all in one. Problem is - because we're now localising it in loads of European languages I was never expecting to have to change the text size dynamically if the copy is too long. So to go and change it to behave like this would be a bit of a mission, so hopefully there is some sort of easier solution...
Maybe an ENTER_FRAME event that tests for the textboxts' text to != ""
I want to generate a variable number of random numbers less than 16 with no duplicate numbers
Ive posted the fla, and what i'm doing is generating a random number and putting it into an array then using a for loop to cycle through the array for each new random number to check if its already there. if it is, then i want to regenerate that number.
if you test the fla you'll see that all i get in my array is some lovely zero's and i sort of know why this is, but don't know how to stop it.
I am trying to convert a string having numbers to an integer.
//15 9's are there var str:String="999999999999999" var res:Number = new Number(str);
But it is not able to convert correctly as the the var res now has the value 100000000000000000. I know that the number has 52 bits of memory, then why is it not able to do the conversion?
create a function that picks out X amount of numbers from a set of numbers? So if X=3, then i need this function to pick out 3 different numbers from say a set of numbers (1, 2, 3, 4, 5, 6, 7, 8) and then stored it into X number of variables.
In saying that, X will only =2, and =5. So in the first instance, i'll need 2 random numbers from the set above that are not the same numbers, and second instance 5 random numbers from the set above (also no repeats of numbers). Then i need to be able to store those 2 or 5 different random numbers from the set into variables to call them with other functions.
I have been using Actionscript 3.0 in Adobe Flash Builder for a few weeks,and I really like it! Bare with me because I'm not really good at it, yet. Anyway, I was wondering how would I go by adding up odd numbers from an array of numbers? I know how to make all of the numbers add up, but adding only the odd numbers I'm not so sure how to do it.
Everything seems to be a string right now & that kinda ruins the whole xml as an internal data structure thing, I don't need a big tree of string I need typed data :-/ Are there any changes I can make to either my XML files or my AS3 code that will force it to cast ints as ints and Numbers as Numbers? Or maybe some kind of type schema I can impose? Not really worked with XML til recently so chances are I'm just ignorant of the canonical way to deal with this...
has anyone had any problems with addition? I'm trying to get two numbers to add and instead it is concatenating them together as a string, however when I multiply, divide, or even subtract them it works fine.
im working on a project for a website, i'm currently having a lot of trouble when i try to add two numbers together.
[Code]...
it all works fine apart from this line here where its adding the old "numberstore" in with "number2" to create the new "numberstore". I've tried all different combinations to get this to work, but all i keep getting is e.g. 1+1 = 11 not 1+1=2.
How do I add numbers in Actionscript 3? I have two dynamic texts totalscore.text = "3"; and myscore.text = "2"; I'm trying to add them like this totalscore.text += myscore.text; And I get this answer 32 instead of 5 it just attaches them instead of adding. why? I also tried it like this var my_score:Number = myscore.text; totalscore.text += my_score; But it still attaches them numbers together instead of adding.
I've been Googling tutorials and so forth but can't find something like this.I wanna do a Preloader, except rather than having"50% Loaded"I want"fifty percent loaded"How does one do this, without having to write in 100 frames of individual text?
I have yet again another simple problem that I've tried to solve 10 different ways, and nothing works. I'm simply trying to add two input text fields' numbers together when the user presses the left arrow key on the keyboard. I'm trying to avoid just typing names in the Var boxes since the text fields' formatting are slightly different. Here's my current code I have attached to the button:
on (keyPress "<Left>") { var Wager = int(_root.AWager.text); var ScoreA = int(_root.Ascore.text); WagerA+ScoreA; }
The following will ensure that any large numbers will only be precise to the hundredths place (related to this answer):
public function round( sc:Number ):Number { sc = sc * 100; sc = Math.floor( sc );
[Code]....
What is the optimal way to round my numbers to the precision of .05? Is there something clever to be done with bit-shifting to get this result? For example, I would like:
I have a problem. I'm trying to get number values from an XML file, but when I parse them, apparently flash doesn't seem to see them as numbers. I base this off the fact that when I type this:
ActionScript Code: var xmlNode = this.firstChild.childNodes[0]; var lAdder:Number = xmlNode.attributes.lengthAdderX;