Hi all!
I am surprised at the following code not working, as it has worked time and again in the past… no wonder i love as3 way more than as2. At the following code, the problem is that i am declaring a variable at a newly created movieclip through attachmovie but it will not be available in the loader events and neither will it show as a variable at the debug window when i select the movieclip…
myListener.onLoadInit = function (trgt:MovieClip) {
trace(trgt.loadId);
}
Xml.onLoad = function(success) {
//blah blah
for (i=0; i<total; i++) {
entry = body.attachMovie("viewer_big","p"+i,i);
myLoader.loadClip("xml image path", entry);
//here lies the problem
entry.loadId = i;
}
}
Now, why exactly the above wont run correctly or why the debug window wont show the variable is a mystery to me. I always handled situations like that so that created movieclips can have their own properties like colors, some text etc. I even tried writting “var loadId:Number = 1;” in the movie clip in the library too, but it still wont show up or trace. All i get is undefined!
Am i missing something here?
George