-
NaN problem
Hello all
I am loading variables from a php file using the following code
mov1.loadVariables("http://localhost/design_data.php?id=2")
This loads a variable called 'total' which has a value of 9
I am then using the following code to duplicate a clip.
i = 0;
while (i < mov1.total){;
duplicateMovieClip(blob, "blob"+i, getNextHighestDepth());
_root["blob"+i]._x= i*50;
i++;
}
Problem is that flash does not recognise 'total' as being numeric.
How do I convert it to a numeric value?
Thanks in advance.
-
noMad soon
try
try with:
i = 0;
var tot = Number(mov1.total);
while (i < tot){
duplicateMovieClip(blob, "blob"+i, getNextHighestDepth());
_root["blob"+i]._x= i*50;
i++;
}
bye,
noir
-
Thanks for the reply but I'm afraid it is still returned as NaN
-
noMad soon
try to trace the mov1.total.
trace(mov1.total);
what do you see in the output panel?
9?
-
Yes it does say 9
How did you know?
-
noMad soon
i should check when the variables are loaded.
try with this:
getVar = new LoadVars();
getVar.onLoad = function(){
trace(this.total);
i = 0;
while (i<this.total) {
duplicateMovieClip(blob, "blob"+i, 10+i);
_root["blob"+i]._x = i*50;
i++;
}
}
getVar.load(yourUrl);
-
Senior Member
- The right of the People to create Flash movies shall not be infringed. -
-
Thank you very much - thats sorted it!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|