-
Check if an object is a Bitmap... how?
I have some code that loops through all the objects in the displaylist. Is there a way to tell is the object it found is a Bitmap?
I've tried things like :
1.) typeof(obj)
2.) if(obj is Bitmap)
But they don't seem to work.
Ideas?
-
Senior Member
I use the following and it seems to work well, but there might be a better solution.
if(String(obj) == "[object Bitmap]")
Trace out the object type using trace(obj) and then replace Bitmap with it. I use custom classes so one of my objects was a Note and i would use the following:
if(String(obj) == "[object Note]")
Basically just a string comparison, i didn't really want to research any solutions so i came up with this for myself.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|