Hey guys,
I am a web developer but I am a beginner in flash. I have been trying to find a solution to my problem but I haven’t had any luck and I am hoping you could point me to the right direction. My problem is I need to load a different background (child) movie clip that would replace the default one when a button is pressed. I have two background movie clips that should be loaded one at a time. I am also going to post a code snippet as I understand people are wary about downloading code from other people.
To summarize, the main file is sample.fla. This loads two background movie clips (bg_1.swf and bg_2.swf) through movieClipLoader.loadClip() method one at a time. It is supposed to swap the bg’s depending on which section of the main timeline they are at (through the on release event of the buttons). The default bg is bg_1.swf which is the “nightlife bg”. Clicking on “restaurant” loads the second bg (bg_2.swf “restaurant bg”) on the same target so that should replace the first/default bg. The problem is it does not. Unloading works but reloading the same target with a different mc only makes it play the current/original background.
I am really starting to get frustrated because it seems like a trivial thing to do. I am just starting to learn flash and I really like to get better at it. I am thinking maybe it is because of the way the background bg is coded that it is not meant to be loaded and reloaded (i did not code the bg’s). If anyone could help in any way, it would be very much appreciated. If my technique is wrong and there is an easier way to achieve the bg swaps, please let me know. Thanks in advance! Any help would be greatly appreciated.