I’m working on a dynamic MySQL driven infinite menu and im having an issue, see if you can’t help me track it down.
check the code:
makefilm = function(){
/* make two clips inside each other
(its supposed to eventually be a dynamic infinite menu)*/
this.createEmptyMovieClip("scroller", 0);
scroller.createEmptyMovieClip("subscroller",99);
/* load all the external variables into easier ones */
var tp1:String = getPictures.thumbpath1
var tp2:String = getPictures.thumbpath2
var tp3:String = getPictures.thumbpath3
var tp4:String = getPictures.thumbpath4
var tp5:String = getPictures.thumbpath5
var tp6:String = getPictures.thumbpath6
var tp7:String = getPictures.thumbpath7
var tp8:String = getPictures.thumbpath8
var tp9:String = getPictures.thumbpath9
var tp10:String = getPictures.thumbpath10
var tp11:String = getPictures.thumbpath11
var tp12:String = getPictures.thumbpath12
var tp13:String = getPictures.thumbpath13
var tp14:String = getPictures.thumbpath14
var tp15:String = getPictures.thumbpath15
var tp16:String = getPictures.thumbpath16
var tp17:String = getPictures.thumbpath17
var tp18:String = getPictures.thumbpath18
var tp19:String = getPictures.thumbpath19
var tp20:String = getPictures.thumbpath20
var tp21:String = getPictures.thumbpath21
var tp22:String = getPictures.thumbpath22
var tp23:String = getPictures.thumbpath23
var tp24:String = getPictures.thumbpath24
/* Make an array of those variables, kind of unnecassary but im desparate */
var tp:Array = new Array();
tp[0] = tp0;tp[1] = tp1;tp[2] = tp2;tp[3] = tp3;tp[4] = tp4;tp[5] = tp5;tp[6] = tp6;tp[7] = tp7;
tp[8] = tp8;tp[9] = tp9;tp[10] = tp10;tp[12] = tp12;tp[13] = tp13;tp[14] = tp14;tp[15] = tp15;
tp[16] = tp16;tp[17] = tp17;tp[18] = tp18;tp[19] = tp19;tp[20] = tp20;tp[21] = tp21;
tp[22] = tp22;tp[23] = tp23;tp[24] = tp24;
trace (tp)/* looks great, everything is in the right spot. */
/* loopity loop */
var i:Number = 1;
while (i <= getPictures.total) {
var filmer:String = ""
filmer = "film" + i
trace (filmer +", "+ tp*)
/*traces:
film1, gallery1/thumb/01.jpg
film2, gallery1/thumb/02.jpg
film3, gallery1/thumb/03.jpg
film4, gallery1/thumb/04.jpg
film5, gallery1/thumb/05.jpg
film6, gallery1/thumb/06.jpg
exxxcccceellent *like burns**/
/* Loop pics into their own little MCs, lined up like a filmstrip, works great */
scroller.subscroller.attachMovie("film", filmer, i, {_x:i*98, _y:44});
/* yes, this V already exists in all the instances */
scroller.subscroller.filmer.thumb.loadMovie(tp*); /* this is the issue */
/* if i change this ^ to "film1" it will load all the pics in that clip,
as would be expected. But this line will not use that "filmer" variable.
I tried every syntax of eval() I could find, I'm gonna start crying soon. :( */
i++;
}
}
var tellwhatgallery:LoadVars = new LoadVars();
var getPictures:LoadVars = new LoadVars();
tellwhatgallery.gallery = 'gallery1';
tellwhatgallery.sendAndLoad("http://localhost/dawn/gallery.php", getPictures, "POST");
getPictures.onLoad = function(){
makefilm();
}