bennyxqg / bulk-loader

Automatically exported from code.google.com/p/bulk-loader
0 stars 0 forks source link

getDisplayObjectLoader doesn't work #97

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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 issue reported on code.google.com by alec...@gmail.com on 23 Jun 2009 at 3:14

GoogleCodeExporter commented 9 years ago
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

Original comment by debert on 15 Jul 2009 at 2:01

GoogleCodeExporter commented 9 years ago
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!

Original comment by alec...@gmail.com on 15 Jul 2009 at 8:39

GoogleCodeExporter commented 9 years ago
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

Original comment by debert on 15 Jul 2009 at 12:49

GoogleCodeExporter commented 9 years ago
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.

Original comment by david.er...@gmail.com on 17 Jul 2009 at 12:08

GoogleCodeExporter commented 9 years ago
Fixed as of revision 296, with tests.

Thanks for the report.

Original comment by debert on 7 Sep 2009 at 4:54