Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why does loadInit = function (url) not work?

Status
Not open for further replies.

fedtrain

Instructor
Jun 23, 2004
142
0
0
US
I am totally confused now. I have NEVER understood listeners and I tried one just now...not working for me.

This is the part that doesn't work...
Code:
listener.onLoadInit = function(target_mc:MovieClip) {

The problem is that my 'target_mc' is a whole path. '_root.picStage.picHolder.locator' Everytime I put that in I got an error for a missing ) or , . I tried to make a variable for target_mc and then make that equal to my path...
Code:
var target_mc = _root.picStage.picHolder.locator
but then nothing happened.

I got the code from an '05 post...
Code:
var mcl:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
listener.onLoadInit = function(target_mc:MovieClip) {
    target_mc._width = 400;
    target_mc._height = 200;
}
mcl.addListener(listener);

mcl.loadClip(picUrl, myClip);

If this won't work...then I have two complete functions to load a pic...then inside one I check to see if pic is loaded...if not reload...if so then resize.

Thanks



"Credit belongs to the man who is actually in the arena - T.Roosevelt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top