# Targeting dynamically loaded swfs

**URL:** <https://forum.kirupa.com/t/targeting-dynamically-loaded-swfs/182796>\
**Category:** Uncategorized\
**Created:** [March 21, 2006, 2:53pm UTC](https://forum.kirupa.com/t/targeting-dynamically-loaded-swfs/182796 "2006-03-21T14:53:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![submariner](https://avatars.discourse-cdn.com/v4/letter/s/ecd19e/32.png) [@submariner](https://forum.kirupa.com/u/submariner)\
**Post date:** [March 21, 2006, 2:53pm UTC](https://forum.kirupa.com/t/targeting-dynamically-loaded-swfs/182796/1 "2006-03-21T14:53:05Z")

</div>

Having trouble targeting movieclips in a dynamically loaded swf. (Flash 8, Actionscript 2).

I have a swf file, which contains a set of duplicated movieclips, that I am loading into another swf file (using the movieClipLoader() class), basically like this:

“swfA” is loading into “swfB”, and I have clips 1, 2, and 3, inside “swfA.”

I don’t seem to be able to mouseover and click clips 1, 2, and 3, when “swfA” is loaded into “swfB”. But when I run “swfA” on it’s own, the clips are active and clickable.

I’ve tried setting “this.\_lockroot = true;” at the top of “swfA”, and that helped in the duplicating script, but still no luck targeting the clips.

I usually execute the duplicating script on the main swf (swfB), but I wanted to contain everything in a swf, thinking it might be simpler. But the targeting problem has me scratching my head.

Any ideas?

Thanks.

---

<div class="post-metadata">

**Author:** ![submariner](https://avatars.discourse-cdn.com/v4/letter/s/ecd19e/32.png) [@submariner](https://forum.kirupa.com/u/submariner)\
**Post date:** [March 21, 2006, 4:35pm UTC](https://forum.kirupa.com/t/targeting-dynamically-loaded-swfs/182796/2 "2006-03-21T16:35:01Z")

</div>

I think i figured this problem out. First, \_lockroot did work-- I created a dummy clip that I placed on swfA, and I was able to target the clip properly. Where I was going wrong was that I was loading images into clips 1, 2, and 3-- and once the image is loaded into the clip, I believe that clip itself is no longer targetable. Instead, what I think will work, is to create a holder clip, inside of which I will place the clip to which I want to load the image-- so that there will still be a movieclip in place once the images are loaded. That holder clip will be targetable.
