I'm trying to dynamically create buttons that will change accordingly to the matching array vars. So far, the only part that isn't working is the mouse down event. The trace just goes nuts and I'm kinda confuse here.[code]...
I'm trying to dynamically create buttons that will change accordingly to the matching array vars. So far, the only part that isn't working is the mouse down event. The trace just goes nuts and I'm kinda confuse here. Perhaps theres a better way of doing this?[code]...
I am building an as3 site where users upload a 5sec audio using there micraphone on there computer. The audio tracks are saved to the server. I am looking for a script that will dynamically merge all the tracks into 1 track to be played back on the site.
I am creating circle shapes with timer (currently with 40 ms delay) so every second it creates 25 circles, it then tweens few of their properties.I have left just the alpha which is important (for simplicity) .On the complete of each tween it tweens each circle's alpha back to 0, and then removes each circle from the stage.
so after I stop the timer, i can still see 20/30 circles on the stage for about a second until they dissaper.I wanted to push those circles in an array so that when I stop the timer, I put all visible circle's alpha to 0, or just remove them all together, so that they immediatelly disappear from stage.
but I also need to remove those circles from array which have already disappeared, so that I always have only visible circles in an array. (not million of them)(notice that tween time is math.random for each circle)
how could i remove them from an array in the same timer event?[code]...
okay, so obviously there is stuff missing from my code b.c i dont feel like copying it all over. its basically an XML controlled style blog, and i'm trying to keep track of whether an entry is open (0), or closed (1), and those values are being stored in 'myArray'. my question is, why isnt that call to myArray overwriting the existing data? i know i have doen this before (maybe not in this fashion, but i know its possible).
I have a game where i add some cartoonish ants, that when they are clicked, they need to be removed from stage. There are 4 differend kinds of ants, so im doing a Math.random for picking which one to add. (ant 1+2+3 have 50% chance to spawn and 4th 50%)
Code: rnd_nbr = (Math.random() * 5)+1;
I have a timer doing 10 tick, and i reset the timer to make neverending. Then i have a math random and if sentences adding mc' to the stage with movement from Tweener, and event listeners for clicks. But i cant figure out how to remove them when clicked. I have done alot of failed tries right inside the click_candy_anty function. I've left them commented out.
Code: import caurina.transitions.Tweener; var ant_index:Array = new Array(10);//index for ants var ant_number:int;
I am working on an interactive quiz type game using arrays and multidimensional arrays.
I am trying to make a dynamic textfield say "the current question" + "Sorry, the correct answer is..." + "the second answer in the first string of answers in the array".
I think I am pretty close, but there is an error in the syntax.
Here is the line of code where I try to do this:
questionHolder.question.text=(String (cat4Questions[0]) + "Sorry, the correct answer is "+ String (cat4Answers[0,2]));
I am getting this error:
VerifyError: Error #1030: Stack depth is unbalanced. 1 != 0.
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:
I would like to be able to create and call an Array dynamically. So to pass a name through a function and create an array based on that name.Then to store values into sections in the array. I got the creating the array dynamically working, but I can't seem to store into it.
Code: Sort = function (numOfVars,Name,toSort){ This works _global[Name] = New Array(New Array (),New Array()); This does not work _global[Name][i][c]= 3 This does not work _global[Name + "[i][c]"]= 3 This does not work _global[[Name][i][c]]= 3 }
variable "myFolder" and "savetofile" are defined earlier within another function, and this function is called back to the first function which establishes the myFolder variable.....oh yea, and fileList is the delimited string variable
the second set of code produces an xml doc, but only populates with <playlist />
I've tried to generate movieclips dynamically the method I have used does the following: Uses a loop runs depending on how many movieclips I want to generate e Each time the loop cycles it creating a new movieclip instance Adds the new movieclip to an array Uses method addChild to put moveclip on the stage then draws a rectangle begins fill ends fill Adds it to that movieclip
I then use a conditional statement checking if the movieclip is the first item in the array if so it sets the current MovieClips x and y position to a chosen value. the first movieclip is used for a starting point to align the rest of the generated movieclips to. If not the movieclips x and y position are set to the previous array items x and y position + current movieclips width or height + the gap I would like them to have. Then the cycle repeats. I've coded this using timeline code and it works fine the shapes appear on the stage no errors. I tried to move this code off the timeline to an as file and the code has no errors but when run I just don't see the objects even if I trace there x and y positions I don't see them on the stage.
Timeline Code var mcArray:Array = new Array();// DEFINE ARRAY FIRST var randomNo:Number; var colorStr:String; var currentColor; var movieClip:MovieClip;// TEMPORARY VARIABLE [Code] .....
I posted something about this a couple days ago but maybe it was a little too messy to understand. Here's a simplified attempt: I have a multidimensional array like this:
[Code]...
and if I wanted to find 'triangle' from the first row I could do something like this:
ActionScript Code: trace(level[0][2]);
What I'm trying to do though, is access elements based on a variable. Here's just an example of what I'm trying to do although it doesn't work:
I've got a weird problem that could probably be easily fixed if I weren't such a novice coder. I'm loading external jpegs into movie clips that are within a movie clip which is within another movie clip (because they are animated as a whole within the other movie clips). The XML loads fine. The "Image" class I've made up is defined. The attributes from the XML load into the array of images.
However, I can't loop through the movieclips to actually load the images. But if I define manually the movie clip loads it loads perfectly. Here is the code that loads the images successfully, but not 100% dynamically:
ActionScript Code: // Define the Images Array var ImageArray:Array = new Array();
i'm porting an old AS2 project to AS3, And have encounter a problem. I've tried a few different things but had no success.in AS2 when dynamically attaching a MC from the library i would sometimes use an array. the array would hold linkage reference's, like so;
ActionScript Code: var mc:String = state_ar[currentState]; this.container.attachMovie(mc,mc,this.getNextHighestDepth());
what I'm trying to do is store a movieclip inside each array element using a for loop.However, I have 2 movieclips to choose from and I want the movieclip to be randomly assigned to each element in the array.Here's what I have so far but the syntax is obviously wrong:
Code: var enemyArray:Array = new Array(); var randomEnemyNo:int; var noOfEnemyMC:int = 2;[code].....
I would like to dynamically create elements based on the array. I would like to just put the array name and append _panel. so menu_item_panel will become settings_panel, info_panel,etc. I cannot figure out how to do that?
What is the best way to create functions dynamically and store them inside an Array? Obviously the bellow is wrong since the array will always trace the last value of the variable "v" (5)
ActionScript Code: var funcContainer:Array=new Array(); for(var v:uint=0;v<5;v++){
Just as the title says. Specifically Im trying to make good use of some error messages by populating them to a TextField.What I've done is to collect all the error messages in an array. I've been working on this for the better part of a day but I can't seem to get it to post as I'd like it. Im seeing the results but each result is in its own TextField. I really want them in one TextField that expands as they get added, each line being separated by a return '
ActionScript Code: var errorHolder:Sprite; var errorArray:Array = ["Errors: "];