# AttachMovie from one swf to another via Local Connections

**URL:** https://forum.kirupa.com/t/attachmovie-from-one-swf-to-another-via-local-connections/275734
**Category:** flash
**Created:** [November 18, 2008, 1:58am UTC](https://forum.kirupa.com/t/attachmovie-from-one-swf-to-another-via-local-connections/275734 "2008-11-18T01:58:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![wolcotter](https://avatars.discourse-cdn.com/v4/letter/w/6bbea6/32.png) [@wolcotter](https://forum.kirupa.com/u/wolcotter)
#### Post date: [November 18, 2008, 1:58am UTC](https://forum.kirupa.com/t/attachmovie-from-one-swf-to-another-via-local-connections/275734/1 "2008-11-18T01:58:51Z")

</div>

I’m having difficulty using AttachMovie method from one swf to another. Here’s the code I’m using.

Sender swf

```auto
btn.onRelease = function():Void {
    var senderLC:LocalConnection = new LocalConnection();
    senderLC.send("targetObj", "doThis");
}

```

Receiver swf

```auto
var receiverLC:LocalConnection = new LocalConnection();

receiverLC.doThis = function() {

    this.attachMovie("button", "button", this.getNextHighestDepth(), {_x:980, _y:534});
};
receiverLC.connect("targetObj");

```

And for the record, the AttachMovie action works just fine outside this function. That’s not the issue.

Any help is greatly appreciated.
