ActionScript 3.0 :: Create Array For Dropzones Of Mc's
May 6, 2010
I want to be able to drop a mc at any given spot that has the same event.target.name as it self PLUS a number. Ex: The mc "leaf" must be able to be dropped at both leaf1_mc and leaf2_mc etc. Right now leaf can ONLY be dropped at leaf_mc. Should I make an array?
I have a drag & drop activity where 3 of the drags can go into 1 of 3 possible dropzones and be counted as correct. On clicking 'Submit', if only some are placed correctly, there's a 'Show me' option - this is the bit I can't do:if some of those with more than 1 possible answer are correct, I don't know how to check which dropzones are free to place the remainder in. My code for the first bit, checking the hitTest is ok:
for (var i:Number = 0; i<aLabels.length; i++) { //3 drag items have 3 poss dropzones: for (var t:Number = 0; t<aNewCorrectDZ[i].length; t++) { //IF ITEM IS DROPPED ON ANY DROPZONE:
Is it possible to, if you have an array of class names like ActionScript Code: var city01names:Array = ["pic_01", "pic_02", "pic_03" ...] make a new array which would read these names, instantiate them, and push them into a new array containing the instances of all these pictures, which I could then use for a slideshow?
I have a glossary that I am trying to build. Each letter is in an XML, I want to create an Array to store letter "A", then dynamically create a "B" array and so on. this is what I have so far:
Suppose you have a round based RPG type game. The player issues directives to his units, your enemy AI issues directives to its units. The problem is that the functions for those directives then have to be executed in a specific order with no relation to the order they were input in and all at the same time with the push of one button.
I just need a little direction here, I just spent the last fifteen minutes searching "AS3 Array of Functions" before figuring out that maybe that's not the way you do it in AS3.
Essentially, I'm looking for the way to store functions, put them in a list to be sorted in a specific order and then execute them in said order.
Suppose you have a round based RPG type game. The player issues directives to his units, your enemy AI issues directives to its units. The problem is that the functions for those directives then have to be executed in a specific order with no relation to the order they were input in and all at the same time with the push of one button.
I just spent the last fifteen minutes searching "AS3 Array of Functions" before figuring out that maybe that's not the way you do it in AS3.Essentially, I'm looking for the way to store functions, put them in a list to be sorted in a specific order and then execute them in said order.
I created a multidimensional array and I am having a hard time using .push to start another line. I have tried many thing however this is where I am at right now:
I'm trying to figure out how to draw a polygon from an array. I've found a few examples, one which the author says works, but am not getting anything to appear. I've traced the array (it's registering) and am getting no errors.
Code: //called from constructor polygon(thisArray);
This is my first time using Actionscript in probably 4 years and I'm learning everything all over again. For example, here's what I tried to jump right into doing and just realized I don't remember how. I'm trying to generate a world map out of tiles I created in Photoshop. I've created a symbol in the library for each tile and want to use an array and a for loop to create the full map.
So far I seem stuck on creating the array itself. I've started by creating a variable for each tile that exists such as m73 = "Lake South" where "Lake South" is the name of the symbol in the library. The full map will be a 32x32 grid of tiles but for now (until I get it working) the array is much smaller. An example of it is like this:
Hopefully this is enough to convey what I'm trying to do. However, when I use something like trace(worldMapArray[0][1]); it comes up as undefined. I've already created the needed for loops that use attachMovie for each iteration in the array, but as the array itself isn't set up right nothing happens.
I want to load many data form xml file so I want to create TextField and put my xml data to that TextField in other hand I have to create many TextField and Control them, how can i create a TextField like an array?
Is there anyway to create a GIF animation from an array already loaded with bitmap images?I would like to simply create the animation in the order the images currently are in.
P.S. -- how would I display it? Just addChild() I'm assuming, correct?
I saw an adobe KB how to create an array with fields. I am having trouble replicating this.
I have the below array structure. I have traced the value of tempName , tempNum - they produce the correct results. But when i trace the array sortValues i get Quote:
object Object
as the value. i wanted it to show the same as tempName and num.
Code: sortValues = new Array(); var tempName:String; var tempNum:Number;
Code: txts = new Array(title,title2); for(i=0;i<2;i++) { txts[i].text=raiz.childNodes[0].childNodes[3].firstChild.childNodes[0]; }
But that does not work...Title and title 2 are two dynamic textfield that i've created in my scene! The problem seems to be the declaration...Does flash allow casting? cuz i tried to cast the "TextField" option and that didn't work as well.
I'm creating a series of banners for a website. There are 3 so far with more to be made. I have made each banner as a separate swf file.The thing I would like it to do it create a randomly ordered array of the banner swf names and then load the banners in that order. Once the banners have been played or loaded through, I would l simply like it repeat that same order again.I have managed to create an array and play through that array in an ordered loop, but how do I create a random array that will do the same thing?[code]
Let's say I have an array with 7 elements in it. I want to create a new array of 15 elements, randomly picked from the first array. Also, I want to have at least 1 of every element of the first array in the second array. How can I achieve this?
This is what I already have:
Code: pageArray= new Array("faces", "days", "sounds", "words", "wires", "arts", "thoughts"); objectsInScene = new Array();
How do I create an array with actionscript if I'm not Using attributes in my XML file. Code: <?xml version="1.0" encoding="iso-8859-1"?> <portfolio><books name="Livros"><image> <thumb>photos/livros/livromisterioth.jpg</thumb> <source>photos/livros/livromisterio.jpg</source> [Code] .....
This is what I would use to create some Array of attributes: Code: var nArray = new Array(); for (var i = 0; i<gallery_xml.firstChild.childNodes[0].childNodes.length; i++) { nArray.push(gallery_xml.firstChild.childNodes[0].childNodes[i].attributes.title); } But how do I extract all the <title> info into the nArray from the XML file above?
I'm taking my old as2 and trying to convert them to 3.what i wold like to know is whats the command for:
- saving a image.jpg while runing a film. . is that posible? -how do i create a array of loaders and mcs? -how do i create an empty movie clip ? -how do i open an internet page inside a swf.its easy to open a pic or another swf.but it cant be similar
I don't know why i am having problems in creating a multidimensional array (an array similar to jagged array in C language or Java) Is it possible to create an array like this in actionsript when used for Flex application??? I tried many methods like creating a simple array and adding other arrays to that or using loops etc. I don't want to add or push the whole array but something like adding one by one variable to a matrix like the one we do in C.
I want to create an array of buttons, the buttons are called popupone, popuptwo, popupthree etc.
When the scene is loaded these buttons visibility is set to false so they are invisible. I want to be able to randomly pick one of these buttons from the array and display it to the screen _visible = true.
So far I'm able to load simple data ( like "name", "address" ...) or to create an array of simple items. I wonder how I can load external data to create an array of multiple choice questions, each of which consisting of ["text of question",["choice1", "choice2", ...], correctChoice]. The questions show one at a time. Something like what I did here: [URL]
I'd rather not use XML if possible, as I don't understand it v well yet.