zerobars
March 25th, 2008, 08:51 PM
I'm loading a SWF into my movie -- using code below. The only thing is that if I have a SWF that has a colored background, and content above that, on loading the background of the imported SWF comes through as _transparent_ (i.e. the color doesn't show) and only the objects _in_ the imported SWF show up --
Why would this be? How to fix? (I can add a colored rectangle that takes up whole stage -- that works OK, but wonder why actual background doesn't show)
Thanks!
public function loadContent(url:String):void {
var request:URLRequest = new URLRequest(url);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Progress Event.PROGRESS, loadProgress);
loader.contentLoaderInfo.addEventListener(Event.CO MPLETE, loadComplete);
loader.load(request);
addChild(loader);
}
function loadProgress(event:ProgressEvent):void {
var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
percentLoaded = Math.round(percentLoaded * 100);
trace("Loading: "+percentLoaded+"%");
} function loadComplete(event:Event):void {
trace("Complete");
}
Why would this be? How to fix? (I can add a colored rectangle that takes up whole stage -- that works OK, but wonder why actual background doesn't show)
Thanks!
public function loadContent(url:String):void {
var request:URLRequest = new URLRequest(url);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Progress Event.PROGRESS, loadProgress);
loader.contentLoaderInfo.addEventListener(Event.CO MPLETE, loadComplete);
loader.load(request);
addChild(loader);
}
function loadProgress(event:ProgressEvent):void {
var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
percentLoaded = Math.round(percentLoaded * 100);
trace("Loading: "+percentLoaded+"%");
} function loadComplete(event:Event):void {
trace("Complete");
}