[as2] Problem with MovieClipLoader

Hey guys, odd one here.

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.

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

Proof of output:

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

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

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

For your URL, try …/images/thumbs/fishbowl.jpg or images/thumbs/fishbowl.jpg

Hm, no luck, so it should work?

I can’t see why it wouldn’t.

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.

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=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.

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

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;
}

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)

whats in the onRelease??

trace the id…

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