I'm having two problems. First off I'm trying to remove container0 on roll out, but I can't remove it from the outView function because it doesn't recognize it.
Second these functions load another image on top of the thumb0 and it disappears right away. I don't know why and I'm trying to stop it from loading 2 instances
var container0:Sprite;
var loader0:Loader;
var boolean0:Boolean = false;
thumb0_mc.addEventListener(MouseEvent.ROLL_OVER,preview0,false,0,true);
thumb0_mc.addEventListener(MouseEvent.ROLL_OUT,outView0,false,0,true);
function preview0(e:MouseEvent):void {
loader0 = new Loader();
loader0.load(new URLRequest("Images/Previews/Australia.jpg"));
loader0.contentLoaderInfo.addEventListener(Event.COMPLETE,show0,false,0,true);
}
function show0(e:Event):void {
container0 = new Sprite();
stage.addChild(container0);
var newLoader:Loader = Loader(e.target.loader);
container0.addChild(newLoader);
container0.width = 187;
container0.height = 200;
container0.addEventListener(Event.ENTER_FRAME,displayPreview,false,0,true);
if (boolean0 == true) {
stage.removeChild(container0);
}
}
function displayPreview(e:Event):void {
e.target.x = thumb0_mc.x + 150;
e.target.y = thumb0_mc.y - 50;
}
function outView0(e:MouseEvent):void {
boolean0 = true;
}