i’ve got this movie clip that im creating empty movie clips inside of to be loaded up by different files . these files are listed in a text file called “Files2.txt”
im trying to make is so that i can dynamically name the instances of each empty movie clip using a for loop and a vairable name… here is my code.
the code to populate the array is in the first frame and i know its working because i did do a trace on it.
if i name the instance of the emptyMovieClip using a string value like “preview1” and replace all the ‘temps’ with “preview1” … but it doesnt work with the dynamically generated name?
any help would be great
**edit… i’ve attached my fla and images in this zip folder…
the code im refering to is in the “mc_NavSquare” actions layer
I’ll start with the onEnterFrame function…why is it there? Surely u don’t need it at all?
Secondly, the loadMovie() function only takes one parameter (the file to load), not 2.
Third, this function’s return value is the created clip. so u don’t need to use the Preview name at all if you’re only using it during the loop. If you want to access these clips later in any way, the best thing 2 do is:
newClip = createEmptyMovieClip(“Preview” + i, this.getNextHighestDepth());
Then, say, if you want to later access the one called Preview0, u would do this[“Preview0”]. But for now, you only want to set up this clip in this repetition of the loop, so you can use the newClip MovieClip variable that you’ve just made, like so:
I’m not sure if I left anything out there - but then, as I said, I’m not too sure y onEnterFrame was there at all.
Next time, try fixing one thing at a time and testing as u go along rather than writing a big block of code and then trying to find problems - it’ll make life a lot easier.