I'm creating a picture gallery in actionscript 2. In order for people to easily create/modify galleries, I have actionscript read in file information through XML. However I have one problem I can't get around. I'm having trouble loading the picture into a movieclip, then being able to change the properties of that movieclip (change _x, _y, and _alpha).
Here is 开发者_如何学编程what I have so far
loadMovie (photos [i].thumb_filename, "thumb"+i);
container.attachMovie ("thumb"+i, "thumb"+i+"_mc", i);
myThumb_mc = container ["thumb"+i+"_mc"];
trace (myThumb_mc); //output is 'undefined'
How come myThumb_mc is undefined?
Is container undefined? Check trace that out also. And trace out photos[i].thumb_filename. As actionsctipt 2 is such a pain to debug, you need to trace out just about everything around your problem to find the cause, everything fails silently. If at all possible you really should be using AS3.
精彩评论