# Controlling main swf through sub swf

**URL:** <https://forum.kirupa.com/t/controlling-main-swf-through-sub-swf/275583>\
**Category:** Uncategorized\
**Created:** [November 16, 2008, 8:52am UTC](https://forum.kirupa.com/t/controlling-main-swf-through-sub-swf/275583 "2008-11-16T08:52:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![smallDot](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@smallDot](https://forum.kirupa.com/u/smallDot)\
**Post date:** [November 16, 2008, 8:52am UTC](https://forum.kirupa.com/t/controlling-main-swf-through-sub-swf/275583/1 "2008-11-16T08:52:07Z")

</div>

i have main fla its name “sections.swf”  
it loads sub swf files “sec1.swf” that has animation that open window movie clip with instance name “cont” and a close btn inside “cont” with instance name “close”

i want to play a specific frame on “mainSection.swf” when i click the “close” button

my code:

```auto

close_btn.addEventListener(MouseEvent.CLICK, closeBox, false, 0, true);

function closeBox(evt:MouseEvent):void {
        // This tell the window to play its timeline
	cont.play();
        // This tell the "mainSection.swf" play its timeline, lets say label "sec1"
	MovieClip(parent).play("sec1");
}

```

Thanks
