Hey All,
I'm building a little project using MTASC & SWFMILL that loads a
compiled SWF into a container MovieClip when an event is fired but the
loaded SWF is not showing up after it loads. Using the LuminicBox.Log
packages I have confirmed that the SWF is indeed being loaded into the
container MovieClip and that it is indeed playing (there's a variable
inside the SWF that changes every once in awhile and I can see it change
in the debugging) the problem is that the SWF's not showing up.
Here's the code from the class that loads the SWF. It's pretty straight
forward; showTout() is called when the SWF is to be loaded, clearTout()
is called when it's to be destroyed and the rest of the functions are
event handlers for the MovieClipLoader. Is there something I'm missing?
This has been driving me nuts since Sunday now...
private function showTout() {
var thisObj = this;
var listener:Object = new Object();
var tout_mcl:MovieClipLoader = new MovieClipLoader();
this.tout_mc =
this.parent_mc.createEmptyMovieClip("tout_mc"+this.parent_mc.getNextHighestDepth(),
this.parent_mc.getNextHighestDepth(), {_width:100, _height:100});
tout_mc._x = (Stage.width / 2) - 50;
tout_mc._y = ((Stage.height - 55) / 2) - 50;
listener.onLoadStart = function() {
thisObj.toutStart();
}
listener.onLoadProgress = function(target_mc:MovieClip,
bytesLoaded:Number, bytesTotal:Number) {
thisObj.toutProgres(bytesLoaded, bytesTotal);
}
listener.onLoadInit = function(target_mc:MovieClip) {
thisObj.toutInit(target_mc);
}
tout_mcl.addListener(listener);
tout_mcl.loadClip("nodeassets/"+this.node.asset+"/tout.swf",
this.tout_mc);
}
private function clearTout() {
parent_mc.logger.info("clearTout()");
tout_mc.removeMovieClip();
}
private function toutStart() {
parent_mc.logger.info("toutStart()");
parent_mc.progress_mc.stroke_mc._xscale = 0;
parent_mc.progress_mc._alpha = 100;
}
private function toutProgress(bytesLoaded:Number, bytesTotal:Number) {
parent_mc.logger.info("toutProgress("+bytesLoaded+","+bytesTotal+")");
parent_mc.progress_mc.stroke_mc._xscale =
Math.floor((bytesLoaded / bytesTotal) * 100);
}
private function toutInit(target_mc:MovieClip) {
parent_mc.logger.info("toutInit()");
target_mc._x = (Stage.width / 2) - 50;
target_mc._y = ((Stage.height - 55) / 2) - 50;
target_mc._width = 100;
target_mc._height = 100;
parent_mc.progress_mc._alpha = 0;
parent_mc.logger.debug(target_mc);
}
Thanks,
Evan
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders