This content has been marked as final. Show 7 replies
Wrong scope. Use:
or whatever path your my_ldr is on.
I don't think this is issue with the scope.. because.. I could ..
my_Idr._visible = false;
and items disappear.
I think this is problem with loading and waiting till it is completely loaded and setting the sizes. For example, MovieclipLoader, you have to add 'onLoadInit' instead of 'onLoadComplete'
Yep. My error. The path is correct. Tried your code and it works fine. And you are using the correct event.
it works fine if the item that I'm loading is small or I'm on fast connection.
On slow connection, it shows up fine and it is in the right place but, the sizes are wrong (Sometimes).
Of course If I setInterval and wait a bit it works fine, but i don't think this is a right approach to resolve this issue.
But, you are changing the dimensions of the loader, which btw can be done right after you create the loader:
this.createClassObject(mx.controls.Loader, "my_ldr", 10);
and the default setting is that the content will scale to fit the loader (see loader.setScale).
But, it won't scale to fit the loader.
The above code is in a movieclip and depending on number of clip arts I need to load (which is in array) and using the length of the array and create instances of this movieclip. And some clips shows up much bigger (When testing on stage.)
>>Of course If I setInterval and wait a bit it works fine
>>The above code is in a movieclip
So the loader is nested in a movieclip that is nested or attached and you have all code on frame 1... meaning there is no alternative to using the setInterval to wait for the methods and properties of the loader component to become available.