arthur-debert/BulkLoader

97 - getDisplayObjectLoader doesn't work

arthur-debert opened this issue · 5 comments

What steps will reproduce the problem?
1. Use loader to load an image
2. Try to retrieve the loader object using getDisplayObjectLoader

What is the expected output? What do you see instead?

I expect to retrieve a loader object; I retrieve null instead

What version of the product are you using? On what operating system?

WinXP, FDT, ADL

Please provide any additional information below.

It looks to me as though the generic _getContentAsType method attempts
always to cast the content to a type, but when you load an image the
content is Bitmap; I want to retrieve the loader!

My reason is that I am agnostic about whether I'm loading an image or a
SWF, and I want to retrieve the size of what I'm loading from the
loaderInfo of the loaded element. I haven't tried it for a SWF yet, but
I'll bet that the same problem pertains.

Original link: http://code.google.com/p/bulk-loader/issues/detail?id=97

alec...@googlemail.com - 2009-07-15 00:00:00

Hi, I'm not unsure of the object's type, and I don't want to get the loader instance by that means! There's a
method called getDisplayObjectLoader, which since I'm loading a display object I would like to think would pass
me back the DisplayObject's loader! Isn't that reasonable? I've stepped through the code and that method fails
because it calls _getContentAsType which is inappropriate for retrieving the loader. I really don't think that the
bug is invalid!

debert - 2009-07-14 00:00:00

Hi Alec.

If you are unsure of that object's type, then I guess the best course of action is to
use:
getContent, and introspect that.

Also note, that you can also acess the Loader instance with:
_bulkLoader.get("theID").loader;

Cheers
Arthur Debert

david.eros.merino - 2009-07-16 00:00:00

I've also run into this issue. Similarly, bl.get(key).loader; doesn't exactly work.

I get an error:
1119: Access of possibly undefined property loader through a reference with static type
br.com.stimuli.loading.loadingtypes:LoadingItem.

debert - 2009-07-15 00:00:00

Hi Alec.

Thanls for getting back to this.
I misunderstood your first comment, and you are right.

I'll make a patch soon, but while that doesn't hit trunk, you can just user:
bl.get(key).loader;

Cheers!
Arthur Debert

debert - 2009-09-07 00:00:00
None