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

Replacing graphic symbol within movie based on button selection

Status
Not open for further replies.

jubalj

IS-IT--Management
Oct 5, 2003
13
NZ
Hi Guys

I have a newbie question, I am using Flash MX 2004 to develop an application.

Is it possible to write a piece of code that will change which graphic symbol is displayed in a movie clip depending on which button the user presses in another form?

I guess the button on selection can set the value of a variable to correspond to the name of the graphic file in the library but what does the code to display a graphic symbol from the library look like?

Regards
Jubal
 
You could simply play with the visibility of the symbol already set within your movie clip...

on(release){
_root.holder_mc.my_symbol._visible = true;
// or... ..._visible = false;
}

Or you could use MovieClip.attachMovie(); and MovieClip.removeMovieClip, as described in the AS dictionary, under MovieClip...

Regards,

cubalibre2.gif
 
Thanks again oldnewbie

a very simple solution and it works well. i should have thought of that.. i just had to make 'movie clips' rather then 'graphic' symbols for the images to get it to work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top