Ello everyone, I"m newbie in this forum and I hope I post in the rite forum..I tried to make a search function to get my dt that store in Array and dynamically placing blinkMC to the stage based on the dt get from Array....
the whole my data was load from txtfile..so here my attempt code so far...
lv = new LoadVars();
myArray = [];
lv.onload = function() {
myArray[0] = this.A.split("||");
myArray[1] = this.B.split("||");
myArray[2] = this.C.split("||");
myArray[3] = this.D.split("||");
mysortfunction();
};
lv.load("route.txt");
function mysortfunction() {
for (var i = 0; i<myArray.length; i++) {
for (var j = 0; j<myArray[i].length; j++) {
myArray[i][j] = (myArray[i][j]).split(",");
trace(myArray[i][j]);
}
}
}
/*stuck at this portion please help me ...
btn.onPress = function() {
dot.removeMovieClip();
myVar = input.text;
for (var i = 0; i<myArray.length; i++) {
for (var j = 0; j<myArray[i].length; j++) {
if ( myVar == myArray[i][j][0]) {
//trace(myArray[i][j][1]+"_"+myArray[i][j][2])
showMe(Number(myArray[i][j][1]), Number(myArray[i][j][2]));
//trace(Number(myArray[i][j][1])+Number(myArray[i][j][2]))
}else if (myArray[i][j][0].indexOf(myVar) != -1) {
//output += myArray[i][j][0]+newline;
trace("Not Found !! At least u know the keywords")
}
}
}
};
function showMe(x, y) {
this.attachMovie("dot", "dot", 1);
dot._x = x;
dot._y = y;
}
*/
- lv = new LoadVars();
- myArray = [];
- lv.onload = function() {
- myArray[0] = this.A.split("||");
- myArray[1] = this.B.split("||");
- myArray[2] = this.C.split("||");
- myArray[3] = this.D.split("||");
- mysortfunction();
- };
- lv.load("route.txt");
- function mysortfunction() {
- for (var i = 0; i<myArray.length; i++) {
- for (var j = 0; j<myArray[i].length; j++) {
- myArray[i][j] = (myArray[i][j]).split(",");
- trace(myArray[i][j]);
-
- }
- }
- }
- /*stuck at this portion please help me ...
- btn.onPress = function() {
- dot.removeMovieClip();
- myVar = input.text;
- for (var i = 0; i<myArray.length; i++) {
- for (var j = 0; j<myArray[i].length; j++) {
- if ( myVar == myArray[i][j][0]) {
- //trace(myArray[i][j][1]+"_"+myArray[i][j][2])
- showMe(Number(myArray[i][j][1]), Number(myArray[i][j][2]));
- //trace(Number(myArray[i][j][1])+Number(myArray[i][j][2]))
- }else if (myArray[i][j][0].indexOf(myVar) != -1) {
- //output += myArray[i][j][0]+newline;
- trace("Not Found !! At least u know the keywords")
-
- }
- }
- }
-
- };
- function showMe(x, y) {
- this.attachMovie("dot", "dot", 1);
- dot._x = x;
- dot._y = y;
- }
- */
and here my dt in textfile
//mod edit - single line of vars broken up to prevent post warping
A=Acircleone%2C320%2C140%7C%7CAcircletwo%2C300%2C110
&B=Bcircleone%2C100%2C200%7C%7CBcircletwo%2C100%2C100%7C%7CBcirclethree%2C100%2C100
&C=Ccircleone%2C100%2C200%7C%7CCcircletwo%2C100%2C100%7C%7CCcirclethree%2C100%2C100
&D=Dcircle
one%2C100%2C200%7C%7CDcircletwo%2C100%2C100%7C%7CDcirclet
hree%2C100%2C100%7C%7CDcirclefour%2C100%2C100
- A=Acircleone%2C320%2C140%7C%7CAcircletwo%2C300%2C110
- &B=Bcircleone%2C100%2C200%7C%7CBcircletwo%2C100%2C100%7C%7CBcirclethree%2C100%2C100
- &C=Ccircleone%2C100%2C200%7C%7CCcircletwo%2C100%2C100%7C%7CCcirclethree%2C100%2C100
- &D=Dcircle
- one%2C100%2C200%7C%7CDcircletwo%2C100%2C100%7C%7CDcirclet
- hree%2C100%2C100%7C%7CDcirclefour%2C100%2C100
so what I after is when user enter the keywords let say "A" and press the search button it will get the dt that stores in array...which is
A=Acircleone,320,140
Acircletwo,300,110
so here,it'll pass this two coordinate("Acircleone(x,y),Acircletwo(x,y)")to attachMC function in order to dynamically placing dotMC to stage...so the result will be two dotMC will dynamically placing to stage accordingly their x,y coordinate..is it possible to achieve it...coz my attemption so far only placing one dotMC only...arghh my head got stuck up please someone can help me out..with this ..
thnks in advanced...and sorry for the long post