# Controling

**URL:** https://forum.kirupa.com/t/controling/261486
**Category:** flash
**Created:** [May 28, 2008, 4:40am UTC](https://forum.kirupa.com/t/controling/261486 "2008-05-28T04:40:45Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![TVM\_XST](https://avatars.discourse-cdn.com/v4/letter/t/4af34b/32.png) [@TVM\_XST](https://forum.kirupa.com/u/TVM_XST)
#### Post date: [May 28, 2008, 4:40am UTC](https://forum.kirupa.com/t/controling/261486/1 "2008-05-28T04:40:45Z")

</div>

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 !

---

<div class="post-metadata">

### Author: ![hasch2o](https://avatars.discourse-cdn.com/v4/letter/h/ba8739/32.png) [@hasch2o](https://forum.kirupa.com/u/hasch2o)
#### Post date: [May 28, 2008, 6:56am UTC](https://forum.kirupa.com/t/controling/261486/2 "2008-05-28T06:56:08Z")

</div>

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

```auto

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

```auto
myLoader.content

```

to control the properties of your child.swf

---

<div class="post-metadata">

### Author: ![TVM\_XST](https://avatars.discourse-cdn.com/v4/letter/t/4af34b/32.png) [@TVM\_XST](https://forum.kirupa.com/u/TVM_XST)
#### Post date: [May 29, 2008, 4:15am UTC](https://forum.kirupa.com/t/controling/261486/3 "2008-05-29T04:15:43Z")

</div>

this is my code

```auto

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

```

---

<div class="post-metadata">

### Author: ![hasch2o](https://avatars.discourse-cdn.com/v4/letter/h/ba8739/32.png) [@hasch2o](https://forum.kirupa.com/u/hasch2o)
#### Post date: [May 29, 2008, 4:42am UTC](https://forum.kirupa.com/t/controling/261486/4 "2008-05-29T04:42:24Z")

</div>

Did you have a look at this page:  
[http://www.kirupa.com/developer/flashcs3/loading\_image\_as3\_pg1.htm](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:

```auto

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;
}

```
