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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Library item exists? 1

Status
Not open for further replies.

thenewa2x

Programmer
Dec 10, 2002
349
US
If there a way in flash to see of a linked object exists? For example, I have in my library a Bitmap with the identifier "ico_UNK_48" (no quotes). How can I discover in ActionScript if the Bitmap exists before I attempt to load it?

---------------------------------------
TINSTAAFL, which is why I contribute.
 
linkageName:String = "bill_mc";
test = createObject(linkageName, "test", 420);
if (test == undefined) {
trace("Not in Library");
}

or maybe attachMovie looking for undefined ?


 
Yeah, I'm looking for some return value that will indicate if the linked object exists. I'm not at my PC now so I can try your code.

Thanks.

---------------------------------------
TINSTAAFL, which is why I contribute.
 
[tt]createObject( )[/tt] is a method to some class. Is there something more independant?

---------------------------------------
TINSTAAFL, which is why I contribute.
 
Hah, oops. Thanks.

---------------------------------------
TINSTAAFL, which is why I contribute.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top