# Error #2025?

**URL:** <https://forum.kirupa.com/t/error-2025/265753>\
**Category:** Uncategorized\
**Created:** [July 11, 2008, 11:01pm UTC](https://forum.kirupa.com/t/error-2025/265753 "2008-07-11T23:01:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![split67](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/split67/32/2089_2.png) [@split67](https://forum.kirupa.com/u/split67)\
**Post date:** [July 11, 2008, 11:01pm UTC](https://forum.kirupa.com/t/error-2025/265753/1 "2008-07-11T23:01:15Z")

</div>

So, i’m loading a swf into my main movie when an area in the main movie is clicked. It loads perfectly, and the close button works fine. The problem is that after it’s closed, if i try clicking to open it again, i get this error…

```auto
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
    at flash.display::Loader/flash.display:Loader::_load()
    at flash.display::Loader/load()
    at ActiveInteractive_fla::MainTimeline/golfLoad()

```

Here’s my code…

```auto
//IMPORTS:::::::::::::::::::::
import caurina.transitions.*;
import flash.events.*;
import flash.display.MovieClip;

//LOADER FOR CONTENT:::::::::::::::
var myLoader:Loader = new Loader();

//GOLF BUTTON:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
golf_btn.addEventListener(MouseEvent.MOUSE_OVER, golfOver);
    function golfOver(evt:MouseEvent):void {
        Tweener.addTween(golf_highlight, {//scaleY:1,
                                              alpha:.60,
                                             time:.5, 
                                             delay:0, 
                                             transition:"easeOutSine"});
}

golf_btn.addEventListener(MouseEvent.CLICK, golfLoad);
    function golfLoad(event: MouseEvent) {
        myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
        myLoader.load(new URLRequest("golf_co.swf"));
        stage.addChild(myLoader);
}

golf_btn.addEventListener(MouseEvent.MOUSE_OUT, golfOut);
    function golfOut(evt:MouseEvent):void {
        Tweener.addTween(golf_highlight, {//scaleY:1,
                                              alpha:0,
                                             time:.5, 
                                             delay:0, 
                                             transition:"easeOutSine"});
}

//FUNCTION FOR CLOSE BUTTON IN INDIVIDUAL LOADED SWF:::::::::::::::::::::::::::::::
var swf:MovieClip;

function onComplete(e:Event):void {
  swf = e.target.content;
  //trace("loaded movie is " + swf);
  //trace("button instance in loaded movie is " + swf.close_btn);
  addChild(swf);
  
  var button:SimpleButton = swf.callout.close_btn;
  button.addEventListener(MouseEvent.CLICK, closeSWF);
}

function closeSWF(e:Event):void {
    Tweener.addTween(swf.callout, 
    {scaleX:0, scaleY:0, alpha:0, time:.5, transition:"easeOutSine"});
    removeChild(swf);
}

```

Probably a simple fix, but i’m frizzity fried and can’t seem to locate it! Thanks for the extra set of eye balls!

---

<div class="post-metadata">

**Author:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [July 11, 2008, 11:08pm UTC](https://forum.kirupa.com/t/error-2025/265753/2 "2008-07-11T23:08:05Z")

</div>

add the loader, not its content (swf).

---

<div class="post-metadata">

**Author:** ![split67](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/split67/32/2089_2.png) [@split67](https://forum.kirupa.com/u/split67)\
**Post date:** [July 14, 2008, 3:19pm UTC](https://forum.kirupa.com/t/error-2025/265753/3 "2008-07-14T15:19:50Z")

</div>

> [@senocular;2357192](#):
>
> add the loader, not its content (swf).

That’s exactly what it is. Thanks for your eyes!
