Hopefully this won't be taken as asking the same question twice...
So I'm working on a Flash website (in AS2) which has an outer index swf which loads sub swf files using loadMovie("subfoo1.swf", placeToShowSwf)
. These in turn load an xml file which tells it what content to load. Everything works peachy, but we'd like to add a button to the index swf that opens a sub swf file with one or two different values for one or two variables.
Unfortunately, just adding a button that says
loadMovie("foo1.swf", placeToShowSwf);
placeToShowSwf.openProject(x);
doesn't work, I assume because openProject(x)
is called on a file that isn't fully loaded. I know that there's not a problem with the code, because I made a button elsewhere that only calls placeToShowSwf.openProject(x)
and there aren't any problems.
I see two solutions, both of which I'm unsure how to do.
- Change the desired value when the swf file is made, like a constructor for a class. But is there some sort of constructor function for swf files? It'd be really nice just to say
loadMovie(new foo1.swf(x), placeToShowSwf)
or something equivalent. - Wait until after swf (and probably xml) is loaded, and then call
placeToShowSwf.openProject(x)
.
Anyone got any guidance towards either of these solutions, or perhaps some other way that my pea-like brain has been unable to fathom?