loadVars & swapDepth array? aieeee

Hi there,

(re-posting this from the Server-Side forum)

I have a flash movie that needs to change the image(s) which are displayed in the swf based on variables from an external file.

ie. – If owner_a in active_1.txt = 1 - show a.jpg - else if owner_a=2 - show b.jpg –

This must happen server side, and will take place when the movie is loaded to the browser. Any images already exist in the movie and do not have to be generated on the fly.

I have identified that loadVars and swapDepth are what I need.

I don’t want to use buttons or any event handler (the movie should just load the variables and display the proper images immediately), other than the onLoad event handler which will sit as part of the loadVars action in frame 1 (of either individual movie clips or the main timeline).

My confusion is as follows: I can only add swapDepth to a movie clip. So I will make each image part of a two-image, two-layer movie clip (image a and image b). Do I have to use the script to loadVars in each movie clip to access the variables from the text file? Or is there a way to run an array, placed in the main timeline, through each and every movie clip so that the loaded variables trigger the proper image?

So lost. :crying:

This is the code (unfinished) I have so far, I believe to be placed on each movie clip.

myVars = new LoadVars();
myVar.onLoad = function(success) {
if (success) {
if (owner_a == “1”) {
else if (owner_a !== “1”) {

Would really, really appreciate some tips here…