I"m creating my first game which is based on the efg framework ( 8bitrocket.com/books/the-essential-guide-to-flash-games/ ). What I'd like to know if it's possible to put a delay inside the processing of an array (in my case it's some scores which appear temporarily when an enemy is destroyed).The purpose of this question is: I'd like to make a delay so the scores appear half a second after the explosion.[code]
possible to have a timer that works inside a 'for' loop? I have created a timer but it only activates each time the frame is run through. I have a for loop with i++ so that I can put objects on the page with a small pause between them. The i++ loop puts all the movieclips on the page simultaneously. I need a delay and a loop because the shuffled arrays will be reset each time the frame refreshes.
I have a function, loadXML, that loads an xml file with a list of locations to OTHER xml files. Within this function I load each individual xml file and run a new function, parseXML, to pass each of the variables I desire from the individual xml files into an array.
This all works fine and dandy on my computer, but when I run it online it breaks down.
What I believe is going on is that the initial xml file loads fine, but because the referenced xml files are on the web and are varying sizes, they stop loading sequentially and the data no longer corresponds to the xml file referenced in referenceListA array. (ie. all the data from each referenced file, item1, item2, and item3 will stay together because they are called at the same time, but will become mixed up from the referenced xml file).
This normally would not be a big deal, but because I want to also create a link BACK to the referenced xml file, sometimes the link will not lead back to right location (it will lead back to another xml file in the list).
I was thinking about adding a time delay somehow in the loadXML function to give time to load the newxml file, but that would still be problematic...
How can I make sure that the referenceListA[i] mathes up to its own information?
I want to create a function based (not frame) delay of about 10 seconds to the function at the start of a flash movie, the code only needs to run once.I'm very new to actionscript and have been given links to SetInterval and SetTimer examples but they all seem to be very complex.The function is below. I believe it's possible to add the commandTimer(delay:Number, repeatCount:int = 0) how me to a simple example.
how I can access array data inside of an mc from the main timeline.. I am hoping to get into an array called children, which is inside of an mc, which itself is inside of an array called mcs.
Here is what I am trying to get to: mcs[m].children[0];
I have an array with 10 buttons with random names, so not btn1, btn2, etc but for the sake of examples, I'll use btn1, btn2 etc each of these buttons have dynamic text like so btn1.textField.text = "something random" etc also in each of this text there is a delimitator "%#%" I can easily use
I am quite new to AS3 and I am having trouble adapting my knowledge of Java to this new language i am trying to make a simple grid in which i could work on each individual square seperately(changing their colour for example). To do so, I created a 2D array,hoping it would allow me to work with some kind of coordinates system. I initialised the array using while loops and for some reason, this does not let me access the array outside the loops.[code]The two last lines are causing the problem, instead of turning the last square red, they return the following error: TypeError: Error #1010: A term is undefined and has no properties.However, when placed inside the loop, there is no problem and the whole grid turns red.
I'm learning a lot by reading the questions and answers that are asked in the Forum. Now it is my turn to ask a question that is probably a rookie, but I have spend 3 days breaking my head to try to find a solution and have not found it yet.
I am trying that the program responds to each click of the player in a box that is white and turns red, with a random click in another box. Something similar to Tic Tac Toe.
My problem is that I can't make te program to access the boxes in the array by programming. When I try the program to access the box with p.ex.: "this.newBox.boxplus30.gotoAndStop (2);" I always get the error "object null or undefined". I have tried everything you can imagine to formulate that line of code, but without success.[code]...
I am doing my first simple game using Flash CS5 and Actionscript 3.0. In this game the player would be able to create a new quiz where it would create an array and add sets of questions and answers to that array. I have been looking on how to do this or anything like it and it doesn't seem to be possible (at least in this way).
I am making an array and I would like for the array to gather the information from an input box inside the array. How would I get the so called array to add the information from name_txt? Actionscript Code: var word = new Array("Hello" + _root.name_txt,"How are you today?");
I got canvas objects stored in an array. Every canvas has it's name property.Is there a way to return a specific name?Actually I need an index number from that array, where I pass a name property of object inside this array (name is taken from event). Something like this:x = array.indexOf (canvasName=event.currentTarget.name)
I have three randomly moving movie clips and one keyboard controlled movie clip which is meant to avoid the tree random flying clips.
I want to do a hit test that basically will do something if anyone of the 3 random clips hit the keyboard controlled clip.
in the hit test i want to be able to have this work for any of the three random clips (flying pumpkins with different instance names, pumpkin1 pumpkin2 pumpkin3). This is all done on an external document class.
I thought about an array but I have no idea really
ActionScript Code: var myArray:Array = new Array(); for(var i=0; i<10; i++){ var p:Particle = new Particle();
[Code]....
I have this array of particles and I was wondering how can I add this particles inside a movieClip, in other words I would like to add particle "p" to a movieClip that I have on the stage with an instance name of "mainMC".
Also, is it possible to display the number of particles (p) inside mainMC in a text field? On this case I know it will be 10, but this will change.
I have an Array where in position 0, there are two items "name1" and "name2", then in position 1, there is only 1 item "name3", and position 2 there is only 1 item "name4".
Now when I trace like this: trace(exampleArray[0].length) The result is 2; But when I trace like this: trace(exampleArray[1].length) The result is 5;
I understand that on the second trace its counting the length of the item so its the number of letters that its returning. I'm just wondering how can I get it to return 1, which is the number of items in that position which is what I'm interested in.
I am trying to reference a movieclip located inside an array to add an eventlistener and function... I am using array[0].add...ect. The code for the first movie clip works, but for the rest I get an error 1010.
I have 4 defined private arrays defined in the constructor of my class.Later down in one of the methods, im trying to push() variables into these arrays, but nothing seems to happen. I tried using this.arrayname.push(), but that doesn't seem to work either.do i need to manually push them by this.arrayname[arrayname.length+1] = "";
I've never actually fooled around with 2d arrays that much. What I need is to access an array and get all the objects inside of it. I actually mocked up a little something to mirror what I want.
I don't have any trouble getting the data, but as you can see that it's pushing each object separately in an array. So it would look like this: I just need to get all of the objects first like {obj}, {obj}, {obj} and then push them into an array.
At the beginning of my Flash game, I do some fairly heavy-duty calculations to figure out path-finding and visibility and that sort of thing. The result of the calculations are a few large Arrays and a Tree datastructure. It takes about 10 seconds on my computer. Is there a way I can do this calculation once and for all, and then just package up the final datastructures right in the the SWF, so that no one ever has to do the calculations again?
I am trying to create an image gallery using an Array with MovieClips inside it but I keep getting this error: TypeError: Error #1034: Type Coercion failed: cannot convert Fullsize_01$ to flash.display.DisplayObject.
Here is the code I made. I know it's probably something simple but I am pretty new to ActionScript. var Fullsize_Pic:Array = new Array(); Fullsize_Pic[0] = Fullsize_01; Fullsize_Pic[1] = Fullsize_02; addChild(Fullsize_Pic[0]);
I have an Array where in position 0, there are two items "name1" and "name2", then in position 1, there is only 1 item "name3", and position 2 there is only 1 item "name4".now when I trace like this:trace(exampleArray[0].length) the result is 2;but when I trace like this:trace(exampleArray[1].length) the result is 5;I understand that on the second trace its counting the length of the item so its the number of letters that its returning. I'm just wondering how can I get it to return 1, which is the number of items in that position which is what I'm interested in.
I have an array filled with several pre-existing variables. I want to loop through this array and update each of these variables that way, so that I don't have to do it line by line. My issue is that when I edit the variable inside the array, it is not changing the actual variable that was assigned to it. See Below for example.
Actionscript Code: var myVar1:uint = 1; var myVar2:uint = 2;var myVar3:uint = 3; var myArr:Array = new Array(myVar1, myVar2, myVar3); for(var a:uint = 0; a<myArr.length; a++){ if(a == 0){ myArr[a] = 9; }}trace(myVar1); // Still traces "1" instead of "9"