# Using localConnection in an image gallery

**URL:** <https://forum.kirupa.com/t/using-localconnection-in-an-image-gallery/248966>\
**Category:** flash\
**Created:** [January 14, 2008, 5:52am UTC](https://forum.kirupa.com/t/using-localconnection-in-an-image-gallery/248966 "2008-01-14T05:52:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![buymylife](https://avatars.discourse-cdn.com/v4/letter/b/dbc845/32.png) [@buymylife](https://forum.kirupa.com/u/buymylife)\
**Post date:** [January 14, 2008, 5:52am UTC](https://forum.kirupa.com/t/using-localconnection-in-an-image-gallery/248966/1 "2008-01-14T05:52:35Z")

</div>

Greetings,

I’m trying to use localConnection to have two different movie clips (a next “button” and previous “button”) control the playback of a flash image gallery. The gallery and the buttons need to be separate swfs, and I’m pretty sure localconnection is the way, though I’m having a pretty rough time getting it to work. (I’m not a TOTAL newbie, but my AS skills def aren’t stellar…)

That said, here’s the code for one of the “buttons” (which is actually a movie clip)

```auto
next_btn.onRelease = function(){
var sending_lc:LocalConnection = new LocalConnection();
sending_lc.send("next", "onRecieve");
}

```

and in the gallery itself:

```auto
var myReceiver_lc:LocalConnection = new LocalConnection();
myReceiver_lc.onReceive = function() {
nextImage();
};
myReceiver_lc.connect("next");

```

Someone trying to do something similar in a different forum was told to “have mySend\_lc send another (string) parameter designating the movieclip you want to trigger to play in myReceiver\_lc.onReceive and use bracket notation in your onReceive handler to convert that string into a movieclip.”

I’m afraid I have no idea what that means …

Any help would be so very very very very much appreciated. MANY thanks –
