flash - ActionScript 3 Loader - swf disappears as soon as loader.width is set -


I am using a loader object to load external:

  var SwfLoader: Loader = new loader (); Stage.addChild (swfLoader); Var bgURL: URLRequest = new URLRequest ("sometestfile.swf"); SwfLoader.contentLoaderInfo.addEventListener (event.complete, loadproduct); SwfLoader.x = 240; SwfLoader.y = 210; // Change the size here? SwfLoader.load (bgURL); Function loadProdComplete (e: event): zero {trace ("file load"); }  

Unless I try to set swfLoader.width or .height (when I want to resize the loaded images), but in this situation SWF is no longer displayed . (It's going anyway because I've got the file from a while ago.)

I have solved the whole error, so that swfLoader.content.width can be used in the whole event.

The width / height of the loader unless the COMPLETE event is not in the fire, Until then wait until you set the size. This can solve your problem


Comments