Controling

I have two SWF .One is Parent.swf and the other is Child.swf.I successfully loaded the Child.swf into the parent.Now I want to control the Child.swf from parent ,using ActionScript. How to do this Please help !

If you could post the code with which you loaded the child.swf it would be easier to reply.

But I guess you will have something like


var myLoader:Loader = new Loader();
myLoader.load(new URLRequest("child.swf"));
//(If you post your code, people can give you a reply using your variable names and stuff, it might be less confusing)

then you could use

myLoader.content

to control the properties of your child.swf

this is my code


  private var SWFName:String="Child.swf";
  private var ldr:Loader= new Loader();
  
public function Parent()
  {
   
   var requ:URLRequest = new URLRequest(SWFName);
   ldr.load(requ);
 
 

Did you have a look at this page:
http://www.kirupa.com/developer/flashcs3/loading_image_as3_pg1.htm

the same thing can be applied to an swf.

in the onComplete event you could attach the swf and start controlling it.
Maybe something like that:


rivate var ldr:Loader;
private var mc:MovieClip;

function loadWhatever(url:String):void {
    // Set properties on my Loader object
    ldr = new Loader();
    ldr.load(new URLRequest(url));
    ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, iAmLoaded);
}

loadWhatever("Child.swf");
 
function iAmLoaded(e:Event):void {
    mc = ldr.content;
    Parent.addChild(mc);
    //control Child with mc
    mc.x = 20;
}