FORUMS: list search recent posts

help! loadMovie not working as expected

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
help! loadMovie not working as expected
on Aug 11, 2006 at 2:59:20 pm

I've got an elearning course that worked just fine when the starting (ie, index) movie was a projector exe file. Now I want to put it on the web and everything works except for this one section. Here's the specifics:

I have a main movie that when the user chooses to view the "mi_gt" section (stands for multiple impositions) of the course they click on the appropriate navigation button to get there. This works fine. They are taken to the mi_gt section and a variable named myRoot_mc.cp is set to mi_gt. This traces out fine so I know it's being set properly.

When mi_gt is set an external swf called cpHolder.swf is loaded into a child movie of the main movie. In cpHolder.swf are some buttons which control the movies that are loaded into two empty movie clips contained within cpHolder:


The buttons are:

When part1_btn is released I want the "mi_gt.swf" movie to load into cpContent. When the part2_btn is released I want the "mi_gt_2.swf" movie to load into cpContent.

But my button event handlers are not working no matter what I try. I stripped out almost all the code to simplify and to keep it to just one section:

//make help_btn and map_btn are invisible so that it will not load the help/map while this movie is loaded
myRoot_mc.help_btn._visible = false;
myRoot_mc.map_btn._visible = false;

//local vars
handouts_btn._visible = false;
handoutsBtnText._visible = false;

if (myRoot_mc.cp == "mi_gt") { //this traces out fine so I know it's being set properly
this.cpContent_mc.loadMovie("mi_gt.swf"); // this works - it loads automatically as expected

if (myRoot_mc.cp == "mi_gt") {
this.part1_btn.onRelease = function() {
this.cpContent_mc.loadMovie("mi_gt.swf"); //doesn't work...nothing happens when I click the part1_btn
if (myRoot_mc.cp == "mi_gt") {
this.part2_btn.onRelease = function() {
this.cpContent_mc.loadMovie("mi_gt_2.swf"); //doesn't work...same as above

I realize it makes no sense to have 2 if statements like the above, but I originally had a whole series of if/else if statements so that the different swf's would be loaded appropriately (in addition to mi_gt I have about 6 other movies that need to load depending on what myRoot_mc.cp is set to). I'm up against a tight deadline and I'm going to have to admit complete and utter failure if I can't get this to work today. I've checked and rechecked instance names. Please help : (


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved