View Full Version : Simple syntax question
for(i=0; i<10; i++){
_root.duh.attachMovie("movie", "movie"+i, i);
_root.duh.movie[i]._x=_root.duh.movie[i-1]_x+=10
}
I guess I'm just not referencing i correctly in the third line of code...I know this is simple...
try:
_root.duh["movie"+i]._x=_root.duh["movie"+(i-1)]._x+10;
Thanks, you're a savior...i knew i was just doing something stupid
not stupid at all.... what you had is alot closer then some of the posts seen around here.
cheers.
Thank you, but alas I have another question.
Im loading in data from a database...So I'm printing out the rows...and im gonna loop through those
so heres me loading everything in
stop();
rand=Math.random(100);
viewing=new LoadVars();
viewing.load("viewnews.php?" + rand);
viewing.onLoad=function(){gotoAndPlay(2)}
now i have a variable declared in php for flash called entries
so i wrote this in the second frame....thing is i have the number of rows display in a text box on the root of the movie...but my loop wont work now..with the entries variable
_root.test=viewing.entries
stop();
for(i=0; i<viewing.entries; i++){
_root.duh.attachMovie("movie", "movie"+i, i);
//_root.duh.movie[i]._x=_root.duh.movie[i-1]_x+=10
_root.duh["movie"+i]._y=_root.duh["movie"+(i-1)]._y+10;
}
I hope this made sense
Thanks(again),
Eric
Oh, nevermind...I got it to work..I'm a schmuck
thanks again
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.