Hi guys,
Is there any way how to access variables of the container movieclip once I load content to it using MovieClipLoader?
System.security.allowDomain("http://www.helpexamples.com");
var _this = this;
var mc:MovieClip = this.createEmptyMovieClip("my_mc", 1);
mc.someVariable = "What the hell";
trace("Tracing outside MovieClipLoader: "+mc.someVariable);
var mcLoader:MovieClipLoader = new MovieClipLoader();
var mcListener:Object = new Object();
mcListener.onLoadStart = function(target_mc:MovieClip) {
trace("Tracing inside MovieClipLoader (1): "+target_mc.someVariable);
trace("Tracing inside MovieClipLoader (2): "+_this.mc.someVariable);
};
mcListener.onLoadInit = function(target_mc:MovieClip) {
};
mcLoader.addListener(mcListener);
mcLoader.loadClip("http://www.helpexamples.com/flash/images/image1.jpg", mc);
This of course doesn’t work, I guess the “someVariable” gets eliminated once the loading begins. Any workaround for this? Thanks!
Cheers,
Poco