PDA

View Full Version : Adding number to a loaded ASP variable


SaGa
02-09-2005, 10:21 AM
Hello,

My asp page sends :

&CATEGORIE1=xxx&CATEGORIE2=yyy&CATEGORIE3=zzz

Action Script code :

system.usecodepage = true;
LoadVariablesNum("matrice.asp", 0);

nbligne = Number(LIGNE);
nbcolonne = Number(COLONNE);

// fonction
k=0;
this.generate = function (col, li) {
var num = 1;
for (var i = 0; i < col; i++) {
for (var j = 0; j < li; j++) {
var newClip = _root.imgDossier.duplicateMovieClip ("FolderClip" + num, num);
newClip._x = _root.imgDossier._x + (i * 130);
newClip._y = _root.imgDossier._y + (j * 130);
num++;
}
}
}
this.generate (nbcolonne, nbligne);

this.generate = function (li2) {
var numCat = 1;
for (var j2 = 0; j2 < li2; j2++) {
var newTxtCat = _root.txtCat.duplicateMovieClip ("CategorieClip" + numCat, numCat);
newTxtCat._y = _root.txtCat._y + (j2 * 130);
txtCat.message.text = CATEGORIE + numCat;
numCat++;
}
}
this.generate (nbligne);

I have a problem with the bold line. I want the function to add numCat to CATEGORIE to get CATEGORIE1, CATEGORIE2 and CATEGORIE3 from the ASP page.

But I only get in the text field the numCat..

tg
02-10-2005, 07:40 PM
txtCat.message.text = "CATEGORIE" + numCat;

having 2 methods called generate may cause you some problems.

SaGa
02-14-2005, 07:32 AM
Sorry, I don't understand the meaning of your function and how to use it.

______________

I have to get the value of CATEGORIE and not the text CATEGORIE.

txtCat.message.text = "CATEGORIE" + numCat;

SaGa
02-15-2005, 10:35 AM
I found the solution :

cat = CATEGORIE.split(";");

// Fonction Catégorie
this.generateCat = function (liCat) {
var numCat = 1;
for (var l = 0; l < liCat; l++) {
var newTxtCat = _root.txtCat.duplicateMovieClip ("CategorieClip" + numCat, numCat);
newTxtCat._y = _root.txtCat._y + (l * 140);
newTxtCat.msgCat.text = cat [numCat-1];
numCat++;
}
}
this.generateCat (nbLigne);