I'm trying to build a musicians site. I'm populating menus, the musicians page, and some other stuff with XML. getting all the attributes (of the artists CD) for each artist. Here's one artist entry in my XML file:
Code: <ARTISTS> <ARTIST> <NAME>AP.9 FED-X</NAME>
[Code]....
Yeah, I don't know how to handle several CDs for each artist. I can see I need a nested loop, but do I store those CD attributes in an array, or create a variable like some_mc["CDLIST"+j] ???
Then I gotta think about building the discography movieclip. I'll worry about that later. What I got working so far is at [URL]
The code is supposed to receive one system id and then scan around that system in all directions, with each direction having its own length. It is like scanning a rectangle around that system where 9*9 = 81 systems.The code works very well; but the problem. I get 8 duplicate results and there is a complete row missing from the results. The one just above the middle row. I think the problem is in the topsystem integer but I don't know what is wrong with it.[code]if you watch the part of the code that has if statements. this part handle the edges.specially zero and 10k. about what i want to do. think about it like a 9*9 dots field in rectangular shape. has 9 rows and 9 columns. each dot has an id from 1 to 10k. the input is the id of the dot in the center of the field (column 5, row 5). as now i know this centeral dot id. i want to loop through the whole field to find the other dots ids using topsystem(the distance between the centeral dot to the upper edge).downsystem (the distance between central dot to the lower edge). leftsystem (the distance between central dot and left edge).rightsystem (the distance between central dot and right edge).the code is working fine but there is 8 missing ids that replaced by 8 duplicated ids.
I have a program where I have around 100 LatLng (latitude longitude) points, and i have to get the largest distance between any 5 of them but you can only go forward (so if latlng_1 is the point number 5 latlng_2 can only be point number 6,7,8,....,100). <-- skip the colored thing if its unclear So I calculate the distance like this:
Code: Select allfor(i=0;i<points_num;i++) { for(j=i;j<........ // three more for loops // and than calculate the distance between all five points and compare if it is larger than previous...
The problem is that the program stops responding for about 2 minutes to calculate this and I would like to know if there is anything I can do to calculate this thing faster? Yes I can reduce the point but than the thing I want to get is less accurate and even if I reduce the points I still want the calculation to be as fast as it can be.
As the title says, i would like to have an object which is nested beneath another objects depth set higher than that of one the is NOT nested. Is this possible if so how, may be real easy and im just over-looking it but
Shouldn't flash detect these before running the script and crashing and having to force quit and restart (and flash startup takes a while)? Like just give an error: infinite for loop or something? And this happened to me a bunch when working with for loops within for loops, when I accidentally used the same variable for both loops, so of course it never ended and crashed flash.
The scenario is to create a lotto game that matches 6 user inputted numbers with 7 randomly generated numbers. The 7th number is a special case (eg bonus ball) WOULD LIKE TO SHOW A KIND HEARTED FALSH GENIUS ALL OF THE SCRIPT IF POSS! (its not tooo long) This code works, but it just outputs the default message: There seems to be a problem with my arrays not comparing? Part of the code is: (prioir to this the user inputs numbers, they are copied to text areas beginning with O, on a button press) On a second button press randomly generated number appear to a timer. //compareResult checks how many numbers match between the two sets of numbers to determine winnings.
I have section of code which works for bouncing some fish movie clips off of the 'ceiling':[code].....
However, I would like to find a more succinct way to program this using a 'for loop'. I tried the following, which did not work and gave me an error (posted at the bottom). [code].....
TypeError: Error #1010: A term is undefined and has no properties.at Function/<anonymous>()
I'm pulling data from an xml doc and created 4 XMLLists to hold the children of the 4 different elements. Inside the onLoad function, I created a series of for loops to go through each list. But Flash stops after going through the first two. I'm very puzzled by this. I got around it by creating a 2nd onLoad function for the last 2 lists, but should I be using a different loop? Curious.. I inserted a break after the first 2 and then the 3rd loaded up...
i am new to flash and i was wondering if there is a way to slow down for loops.Like i can set how many seconds till it goes and loops again. I have tried setInterval but didnt work.here is my code:[code]
My situation is that in the game I'm making, I have a movable turret firing duplicated bullets. I need to hittest them against a duplicated set of oncoming robots. I've tried using a for loop, but I just can't get it to work.I've attached the .FLA, and I would be grateful if anyone could point out what I'm doing wrong (ignore the values for removing the clips and the random duplication; I had to shrink the stage size to make the file size smaller!)
why this code dosent work at the same time in the timeline, and why only envent put inside the attacHMovies or duplicated Movies work, if i put them in the forr loops they don work.
I want to attach a MC dynamically so that I have 12 rows and 12 columns of _mc box on the main stage:[code]I think it can be done only with a nested loop but so far, well, my head's in a loop!
Code: var cityArray:Array = new Array(); cityArray[0] = "southland"; cityArray[1] = "otago"; cityArray[2] = "westland";
[code]....
What have I done wrong? I'm trying to give each mc it's own number based on the name position in the array etc etc - It returns 18 for all of them when I click them one at a time.
We have a For Loop that duplicates and movie Clip.
for (counter=2;counter<=15;counter++) { duplicateMovieClip(enemy,"enemy"+counter,counter+1 00); }
On a hit test we want to remove all the duplicated movieclips. I acomplished this using a new scene with a frame action contianing another For Loop and a remove movie clip action. Hit test true move to new scene play frame action.
for (counter=2;counter<=15;counter++) { removeMovieClip("enemy"+counter); }
This worked.Is there a way to put a stop of the For Loop or Put a stop on the Duplicate movie clip?
I am trying to make a sound crossfading between the loops (an example would be: same as in a "Winamp" media player you toggle the Crossfading function in a Modern Skin and select a duration of it). Say I got a loop of 10 seconds, altho it is not perfect as its cut of the song without a proper editing tool. Any way I could accomplish it by using the ActionScript?
I am wanting to create an array. 10 values in it (couting from 0 index to 9). Each 'place holder' will have a corresponding value to it;s index i.e.
myArray[0]=0 myArray[1]=1 etc...
I can do that in a for loop. But then I want to attach each value to a single variable name. I then want to change that each variable to a string. I then want access to all the variables outside of the for loop.
var i:Number; var aArray:Array = new Array(); for (i=0; i<10; i++) {
[code]....
The output error is 1084: expecting identifier before aArray.
I've been trying to make a sound-loop player for quite some time now (i'm new to as3) and i'm pretty close to do it but still Ok, i've made six letters converted them into buttons and i want them to play a different wav sound loop each one whenever i click on them and to stop the sound when i click again.This works fine for the first button but not for the rest of them because i dont know where to insert the similar code for the rest of the buttons.
import flash.media.Sound; var sound:Sound = new The_Rloop5(); var soundControl: SoundChannel = new SoundChannel();
I am writing a loop and want to position 25 boxes in a square. I can make 5 boxes appear in a line, but can't make 25 boxes appear in a square without writing 5 seperate loops (e.g. j, k, l, m, etc.). This seems long-handed, can I shorten the code? Here is the code I have used so far:
I have a five mouse click functions, each with a different navigateToURL link, and each one appears on a different key frame. The probelm is that once the end of the swf is reached and it loops, it gets stuck on the last function and therefor only links to that last URL.Is there a way to reset functions at the begining? Or is there a better way to do this?Code from one of my keyframes:
First_btn.addEventListener(MouseEvent.CLICK,onMouseClickFirst); function onMouseClickFirst(e:MouseEvent):void{ navigateToURL(new URLRequest('http://FirstLink.com'));}
I have a test here which is for a more complex interaction, but the principle is the same. What I would like to know is how to make the code more efficient, possibly through array loops?