basically I need a loop within a loop to compare two different arrays in my actionscript3 lottery game. I have attempted the loop but I cannot seem to get it to work ...
[Code]....
So basically within this code check_win is a button. Once the button is clicked it runs the loop. It is meant to take an instance of matches which contains 6 properties and loop until index is greater than matches. According to my output this is happening but the second loop doesn't appear to do anything.
How do i word a for loop to make it loop through multiple arrays?I want 1 for loop to loop through multiple arrays in order to move/alter objects.I want to keep the arrays separate.
ActionScript Code: characters = new Array(); characters[0] = male;
I need to assing two dimensional with random numbers so i just try to do it in a loop, but it can not be done the way I show You below.[code]trying to run that code I just get an error...
I have a problem to use each code in for loop. I create 2 Circles in my stage with addChild code. And I gave them function ( mc.x += 2; ) and the time they get to the end of stage I gave the function ( mc.x -= 2; ) but my problem is when one of the circles get to end and wants to move to the right the other circle move with him to the right. and I think the each code in for loop helps me. but I don't Know how to use it in my actions.
my code is:
ActionScript Code: var mc1:Circle = new Circle(); var mc2:Circle = new Circle();
[code]....
What should I change in this code to use each for loop..?
I wanted to know if there's a way to add more options to a for loop regarding arrays. Say the current position in the loop is 1 (thats where my block is) then i want it to check the array if current position -1, +1,-3,+3. if any of these are null (thus, empty spot.) Because the block moves across a board i need the script to be adaptable.
I'm trying to display strings stored in arrays with a for loop, i could just write out each array like:[code]but it only displays the last one, is there a way to display it from 1-10, or 1-any number?
I have two arrays - one for movieclip buttons and one for images. The idea is - rollover a button and it loads it's respective image. I have a loop for the button array that pretty much loads each button and creates a rollover state for it. At the moment it just traces what button the mouse is over. The problem is trying to load the correct image based on that button. The way it is now - it will only load the same image for all the buttons.
Code: tagPosition = 0; viciousImgs = new Array("vaI1_mc", "vaI2_mc", "vaI3_mc", "vaI4_mc", "vaI5_mc"); viciousButs = new Array("va1_mc", "va2_mc", "va3_mc", "va4_mc", "va5_mc"); vicious = new Array("vicious_mc", "uTitle_mc", "uTxt_mc", "uButs_mc", viciousImgs, viciousButs);
So im recreating my ear training program with more effective coding so i can add on to it. original i did.
//88 C8 var mp3Req88:URLRequest = new URLRequest("88.mp3"); var mp3_88:Sound = new Sound(); mp3_88.load(mp3Req88);
I basically got 88 sound files (each note of the piano) doing this code 88 times for each sound. with mathamatical equations made my ear training program.
Is there a simpler way to import these sounds in a loop of some sort so i dont have to do this 88x for the piano and however many times for the other instruments i will be including?
thus var i have tried things along the lines of below with failure
var i:int; for (i = 0; i < 5; i++) { var pianoMP3Req+i:URLRequest=new URLRequest("piano/"i+"mp3");
[code]In my real application, I've actually created a named array with element1 as key...so that I can address it directly by it's name.The problem is that - in my real application - the array2 element doesn't share a name in common with element1 (so I could address it by its name..as just told you,using named array) but with element5.
how to create arrays with the same name inside an array of object. When I populate the array with data from a xml file, all of them got the same value.[code]If you put these together and test run the project, you can see that the two arrays of adsBoard have exactly the same data.
So I hava array Links and array Params with same langth NSo what I need is to create an object where for each link from Links I will be able to see param from ParamsAnd than for example to be abble to call something like
for each( item in object) if (item.param == "some value") { // some code
I list all question areas in an array. I now want to loop through the array and see if any area element is represented more than once. And if so, how many times.This is the array of question areas that I have[code]...
What I am trying to do is create an array of 12 out of an unknown number of thumbnails (there are 23 at the moment though this will change).So basically first 12 in array1, second 12 in array2 an so on until all thumbnails are in an array. So I need to create each array using a dynamic name, in this case 'pagearray' I.E pagearray1, pagearray2, pagearray3.
So here is the code I am trying though I have only managed to get the code to create the one array so far. The last one. This code is within a for loop that iterates through all the thumbnails.[code]...
I have an array of movie clips (representing band members) which have various properties, among them them a property which tells where the band member went to after they left their current band. For those who formed a new group, I want to create an array. Within that array, I want to group all the ones that left for the same group into secondary arrays. So, if you had five band members and 2 of them left for group X and 3 left for group Y. What's the best way to do this? This is, roughly, my code:
[Code]...
Alternatively I suppose if I could do without a multidimensional array and just loop through all the members and say - for those members whose group is the same, perform this function, with the name of that same group passed as the parameter for the function. I guess the trouble I'm having is identifying who's the same.
I am creating a menu buttons with the use of array. A reference link is given below. -- grandmother.increating such associative buttons with array (actionscript 2).
I retrieve XML data in Flex via HttpService. I have the resultFormat property on the HttpService instance set to HTTPService.RESULT_FORMAT_OBJECT. The result contains data similar to this:
<!-- ... --> <children> <item><!-- ... --></item>
[Code]....
I get an array named item beneath the element children when there is more than one item sibling. If there's only one, the conversion can't distinguish it from a scalar.
What do I need to change to have Flex convert all item elements to an array with 0 or more elements?
What would I have to do to get an array member children, dropping the item wrappers altogether?
The XML is generated by Struts on the server side. I always have the option to change the structure of the document there, but right now I'm interested in what I can do with Flex.
can you create arrays of Bitmap and Sprite Objects? or Custom Objects?
if not, how would you typically create multiple Objects of the same type? just a loop with
var enemy:Sprite = new Sprite(); for(var count:int=0; count<10; count++) { enemy = new Sprite();
[Code].....
That way could be fine for many things, but theres other things I want to do.. such as, create an array of wav sounds.... and my program could pick and choose them, so they wouldnt need to load them on demand.. midi files too.
I have some buttons that create draggable movie clips in arrays. But when I click on one button, and then another, for some reason the previous movie clip dissapears.Try clicking on one button a few times, then clicking on another, then another...