Skip to main content
Inspiring
June 22, 2006
Answered

Referencing multiple images by ID

The overview: I have a movie with a text input that pulls a name from an array and associates a logo ID with it. After the user selects a name, they hit a button which loads the logo image into an empty movie clip. I'm trying to figure out the best way to set up the movie that shows the logo . I have about 50 logos that need to be associated with a name and I don't know how to call the exact logo from flash based on the ID I have in the array.

I was thinking of creating one .swf with 50 frames and on each frame have an action that creates an empty movie clip and attaches a movie from the library (one of 50 movie clips with one logo per movie clip). Can I then use the Linkage property to manually associate an ID with the logos? I still don't know the actions necessary to put on the button that would make the appropriate logo ID appear. Arrgg.

I know there is a better way but i'm just not seeing it. Any suggestions?
This topic is closed to new replies. Start a new post to keep the conversation going.
kglad
kgladCorrect answer
Community Expert
June 22, 2006
yes, assign each a linkage id that matches the string stored in the array. use an associative array so you can associate particular keywords with particular logos. for example, if you want to associate keywords kw1, kw2, etc with logos logo1, logo2 etc:

5 replies

jtouheyAuthor
Inspiring
June 22, 2006
that's the ticket! thanks.
Translate
kglad
Community Expert
Community Expert
June 22, 2006
you're welcome.
Translate
jtouheyAuthor
Inspiring
June 22, 2006
In this case, since I know the exact amount of logos being used and I know it won't change plus the fact I know each logo is around 3-5k... I think it would be safe to preload them into the main movie and have them available to call from the library.

With that said, would I then procede to assign them linkage ID's matching the ID in the array? How would I then associate the array ID with the Linkage ID to load into my movie clip?

Translate
kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
June 22, 2006
yes, assign each a linkage id that matches the string stored in the array. use an associative array so you can associate particular keywords with particular logos. for example, if you want to associate keywords kw1, kw2, etc with logos logo1, logo2 etc:

Translate
kglad
Community Expert
Community Expert
June 22, 2006
your first decision is whether you want to load the individual logos into your main swf or you want them all to be available in your main swf's library when your main swf loads. that decision will depend upon the size of the logos, the difficulty of assigning linkage ids to each of them and possibly other factors.

once you make that decision you can procede with the actionscript.
Translate