I am trying to use the code below to get the info from the arrays and if the value is +,-,* or / the array value is posted into a new array otherwise it is posted to a number array:
Code:
var i = 0;
operator = new Array();
calc = new Array();
var myArray = ["0","1","+","2","*","5"];
while(myArray.length > 0){
[Code] .....
Which shows the length at only 1??? however the code seems fine from the other trace info.
[code]I want to input a number and find a match for the number, returning the values on the row in to specific fields for each number. For example, if I input the number 10 in an input field, I want the number 1.2276, 0.00100, 106.38 and the rest of that row to output these values I have seen so many options, don't know where to start.
I'm trying to create a shuffle button for my mp3 player. I don't want it to repeat any song in the xml playlist until all the songs are played. Is there to display a random number on the click of a button, without repeating any number in the array until all the numbers in the array are used?
I have two arrays. One contains numbers and the other contains strings. I want to do a sortOn(DECENDING) for the number array and then have the string array sort to match. if my string array is
So my array has 5 numbers in it and also the ability to add more to it as the user sees fit.I want to be able to display the max and min number in the array. I made a loop but i am not sure how to make it select the highest or lowest number automatically without me selecting it manually by typing it in.This is my code for determining this:
// Determine Min and Max Markfunction maxandminMark(){var markIndex:int;markIndex=(marks.indexOf(marks));if (markIndex != -1){ for (var i = markIndex; i < marks.length; i++) marks[i] = marks[i+1]; trace(maxandminMark);}}}
I'm using a PHP Script to create XML. Which pulls through the data from a Database. I have an video list, which pulls through X amount of videos. But I want to show them 5 at a time. I want to hide a button once it reaches the amount of videos in the XML.Hope there's enough detail in this question. My script is as follows.....
// Event Handler protected function videoRetrieval_resultHandler(event:ResultEvent):void { var videoData:ArrayCollection = event.result.videos.video;
If I want a a random number not to be equal to a number in an array so that the random number dose not repeat itself.Or if can't be done with an array how would you get a random number to randomly generate numbers but not repeating itself?
and the result is putting the two texts of a1 and a2 together not summing them, means if a1.text=1 , a2.text=2 the output of b is 12 how could i make it to sum the numbers?
I have an array, strictly numbers, how could I add... say array[0](value=2)+array[1](value=1) to equal 3? What I come up with is an undefined error, or not a number...
I am trying to trace an index number from an array.
I know this must be about as simple as it gets, but I just cant figure it out.
I know the contents of the array are all asighned a number begining with 0.
I need to find out the index number of a thumbnail when you click on it.
Code: function whenThumbsLoad(event:Event):void{ var thisThumbsLink:String = clipPathList[ c ]; var thisThumbsTitle:String = clipTitleList[ c ];
[Code].....
I know I can trace the thisThumbsLink and get that, but all I need is it's index number. Also I trace(c); and I get how many there are, but I just don't know what to trace to find the index number.
I have an array for my navigation bar (btn1, btn2, btn3 etc) where when the user clicks on a button, it goes to the correct page, and all is good. Now, I when the user clicks on a page, I want it to play a funtion where the button (movieclip) goes to frame2, and the button is disabled. How do I say 'if user clicks btn1, and is on page1, now disable btn1'. My code is below:
I am building a quiz game. I generate a random number. I then compare the number to an array of questions already asked. If a question has been asked, I need to generate another random number and check again if this questions has been asked, until I find a question that has not been asked. I am getting lost in all these loops.
var completedQuestions:Array=new Array(); function getQuestion() { var qnumber=randomNumber(0,numberOfQuestions-1); //I did not include the randomNumber function as this is not the problem
I have array where in first position I have few information:for example:aa=[122-345-567, 4568-765-875, ......]I want to take only number 122 or 4568. What to do? How to cut from array numbers before dash?
I'm having hard time figuring out how to handle division with random numbers from arrays using AS3.On my stage, I have two dynamic boxes; box1 and box2 and a button, btn.in timeline I have the following arrays:var myDivisor:Array = [3,6,9,12,15,18,21,24,27,30];var myDivider:Array =[1,3,6];The idea is to divide box 1 by box 2, so myDivisor should be a random number higher than a random number from myDivider.[code]
i used a for loop to addChild of a class object(movieclip) to the stage and at the end line of for loop after addChild i push it into an array and i add eventlistener to it , such as
for (var i:Number = 0; i < 9; i++) { ..... clip = new CLIP; ......
[Code]....
and if i want to get the array number which currently accessing how can i do that ? for example, i drag one of the mc class from the array which has already added eventlistener above.
how can i get the number of the array which im accessing ? evt.target..... etc ?
Ive got this array with numbers in it, which i want to use for some simple calculations, but i keep getting the message that the array data isnt a number:
The whole is in a for loop, with teller1 as increasing value.
the code: var xco:Array = [180,233,271,292,292,270,231,179,124,74,34,11,9,30,70,121];var yco:Array = [11,33,73,124,181,232,270,290,291,271,234,183,125,72,33,11];
I want to find a way to only allow certain objects into an array that have a certain word in thier class name. Or at least find the optimal way of doing something like this. Heres the details. I have an Array that stores all the objects dropped into a cart.
function addProductToArray (e:MouseEvent):void{ currMC = (e.target as MovieClip); myCart.itemsInCart.push(currMC); trace(myCart.itemsInCart);}
The Action script code below takes the strings in the array (pgtit) and creates a dynamic navigation bar I am trying to trace the index number of the array being click I just seem to get -1.
var pgtit:Array=["link1","link2","link3","link4"]; var xPos = 0; var menuHolder:MovieClip = new MovieClip; addChild(menuHolder);
How could I get a number of all same objects in array (lets say I have five "Grass" objects and ten "Wood" objects. Now I want to get the number of Wood objects.