# \[as2\] Problem with MovieClipLoader

**URL:** <https://forum.kirupa.com/t/as2-problem-with-moviecliploader/265136>\
**Category:** flash\
**Created:** [July 4, 2008, 2:53pm UTC](https://forum.kirupa.com/t/as2-problem-with-moviecliploader/265136 "2008-07-04T14:53:23Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [July 4, 2008, 2:53pm UTC](https://forum.kirupa.com/t/as2-problem-with-moviecliploader/265136/1 "2008-07-04T14:53:23Z")

</div>

Hey guys, odd one here.

```auto
function loadImage(id:Number):Void {
    var loader:MovieClipLoader = new MovieClipLoader();
    var object:Object = {};
    loader.addListener(object);
    object.onLoadInit = function(target_mc:MovieClip):Void {
        trace("rr")
    };
    loader.loadClip(data[id].thumb,myDock[id].container);
}

```

A code that I have used on numerous occasions\* (above) \*has decided it doesn’t want to work. I know the \*loadImage \*function is called as I have tested with traces, along with the variables. data[id].thumb and myDock[id].container output correctly when traced object.onLoadInit traces _[Type Function]_ and loader outputs _[object object]_, I just can’t seem to get flash to output “rr”, as it should.

I also do not get any “error opening URL” messages.

I have no idea what’s going on, do any of yous have any ideas/suggestions?

Any help appreciated on this somewhat odd issue.

---

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [July 4, 2008, 4:00pm UTC](https://forum.kirupa.com/t/as2-problem-with-moviecliploader/265136/2 "2008-07-04T16:00:08Z")

</div>

I just checked; loadClip returns false, just have to figure out why.

Proof of output:

```auto
function loadImage(id:Number):Void {
    var object:Object = {};
    var loader:MovieClipLoader = new MovieClipLoader();
    loader.addListener(object);
    object.onLoadInit = function(target_mc:MovieClip) {
        trace("rr");
    };
    trace("var object:Object = "+object)
    trace("var loader:MovieClipLoader = "+loader)
    trace("loader.addListener(object) -> "+loader.addListener(object));
    trace("object.onLoadInit = "+object.onLoadInit);
    trace("loader.loadClip(\""+data[id].thumb+"\", "+myDock[id].container+") -> "+loader.loadClip(data[id].thumb, myDock[id].container))
    loader.loadClip(data[id].thumb, myDock[id].container);
}

```

outputs

```auto
var object:Object = [object Object]
var loader:MovieClipLoader = [object Object]
loader.addListener(object) -> true
object.onLoadInit = [type Function]
loader.loadClip("./images/thumbs/fishbowl.jpg", _level0.container.item0.container) -> false

```

---

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [July 4, 2008, 11:45pm UTC](https://forum.kirupa.com/t/as2-problem-with-moviecliploader/265136/3 "2008-07-04T23:45:54Z")

</div>

sorry, but I really need to get this sorted. bump

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [July 5, 2008, 12:10am UTC](https://forum.kirupa.com/t/as2-problem-with-moviecliploader/265136/4 "2008-07-05T00:10:06Z")

</div>

For your URL, try _…/images/thumbs/fishbowl.jpg_ or _images/thumbs/fishbowl.jpg_

---

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [July 5, 2008, 3:15am UTC](https://forum.kirupa.com/t/as2-problem-with-moviecliploader/265136/5 "2008-07-05T03:15:55Z")

</div>

Hm, no luck, so it should work?

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [July 5, 2008, 3:31pm UTC](https://forum.kirupa.com/t/as2-problem-with-moviecliploader/265136/6 "2008-07-05T15:31:27Z")

</div>

I can’t see why it wouldn’t.

---

<div class="post-metadata">

**Author:** ![energy](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@energy](https://forum.kirupa.com/u/energy)\
**Post date:** [July 5, 2008, 10:12pm UTC](https://forum.kirupa.com/t/as2-problem-with-moviecliploader/265136/7 "2008-07-05T22:12:11Z")

</div>

Just try this,

1. Don’t use the name “object”

loader.addListener(anyname\_exeptobject);

1. If the “image” folder is in the same directory where .swf then in .loadClip use:  
“images/thumbs/fishbowl.jpg”

If the above doesn’t work then create some movieClip “mov” on the same layer and see if

**loader.loadClip(“images/thumbs/fishbowl.jpg”, mov);**

works.

---

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [July 6, 2008, 3:32am UTC](https://forum.kirupa.com/t/as2-problem-with-moviecliploader/265136/8 "2008-07-06T03:32:01Z")

</div>

hey energy, thanks but I have tried all of the above already; I am hoping it’s just a security issue. I’ll keep trying to figure it out and get back to yous when/if I do

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [July 6, 2008, 5:20am UTC](https://forum.kirupa.com/t/as2-problem-with-moviecliploader/265136/9 "2008-07-06T05:20:29Z")

</div>

[QUOTE=nathan99;2354123]hey energy, thanks but I have tried all of the above already; I am hoping it’s just a security issue. I’ll keep trying to figure it out and get back to yous when/if I do[/QUOTE]

That’s what I was thinking but it’s odd that there’s no error/warning.

---

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [July 6, 2008, 6:50am UTC](https://forum.kirupa.com/t/as2-problem-with-moviecliploader/265136/10 "2008-07-06T06:50:17Z")

</div>

well I just used loadMovie to check the path was correct, and it loaded. So I gotta keep searching. The answer’s there somewhere

---

<div class="post-metadata">

**Author:** ![energy](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@energy](https://forum.kirupa.com/u/energy)\
**Post date:** [July 6, 2008, 7:04pm UTC](https://forum.kirupa.com/t/as2-problem-with-moviecliploader/265136/11 "2008-07-06T19:04:24Z")

</div>

Have you tried setting \_x,\_y like below:

Example:

**Ltener.onLoadInit = function(target\_mc) {  
target\_mc.\_x=0;  
target\_mc.\_y=-30;  
target\_mc.\_width=200;  
target\_mc.\_height=200;  
}**

---

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [July 7, 2008, 1:13am UTC](https://forum.kirupa.com/t/as2-problem-with-moviecliploader/265136/12 "2008-07-07T01:13:05Z")

</div>

thanks, but that’s not the issue, loadClip returns _false_ (as it should when it fails), and it never traces “rr” (ie onLoadInit is never called)

---

<div class="post-metadata">

**Author:** ![pantas](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@pantas](https://forum.kirupa.com/u/pantas)\
**Post date:** [July 7, 2008, 2:44pm UTC](https://forum.kirupa.com/t/as2-problem-with-moviecliploader/265136/13 "2008-07-07T14:44:14Z")

</div>

whats in the onRelease??

trace the id…

---

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [July 7, 2008, 3:40pm UTC](https://forum.kirupa.com/t/as2-problem-with-moviecliploader/265136/14 "2008-07-07T15:40:07Z")

</div>

if you see post #2, I have tested what values are going through and have shown the output. To me, it all seems fine
