You need to declare a variable in your class and assign the movieclip to it - 
outside a function, ie

var myMC:MovieClip;


then you could change

addChild(loadEvent.currentTarget.content);

to 

myMC = loadEvent.currentTarget.content;
addChild(myMC);

and manipulate it

myMC.x += 10;

remove it

removeChild(myMC);

_ _ _
Erik Mattheis
Senior Web Developer
Minneapolis
T  952 346 6610
C 612 377 2272

Weber Shandwick
Advocacy starts here.

PRWeek Global Agency Report Card 2009 - Gold Medal Winner
The Holmes Report Global Agency of the Year
PR News Agency of the Year

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Lehr, Theodore
Sent: Tuesday, March 09, 2010 8:19 AM
To: Flash Coders List
Subject: [Flashcoders] Manipulating and Removing loaded swf

Given the code below that I found on the web - I have 2 questions:

1) How would I manipulate the swf (i.e. change it's placement on the stage)

2) How would I remove it?


TIA

Ted

import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.Event;
import flash.events.ProgressEvent;

function startLoad()
{
var mLoader:Loader = new Loader();
var mRequest:URLRequest = new URLRequest("MouseActions.swf");
mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, 
onProgressHandler);
mLoader.load(mRequest);
}

function onCompleteHandler(loadEvent:Event)
{
        addChild(loadEvent.currentTarget.content);
}
function onProgressHandler(mProgress:ProgressEvent)
{
var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;
trace(percent);
}
startLoad();

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to