button code inside a movieclip not letting call an external swf

Hello, I have a on realease code that is not letting me call an external swf.  On the main movie...on frame 1 i have the following code:

---------------------------------
_root.currMovie = "welcome";
container.loadMovie(_root.currMovie+".swf");
------------------------------------

then on the stage i have 5 buttons..each one inside a movieclip for some animation rollover.  The code inside the movieclips that I have for each button is:

----------------------------------------
on (rollOver) {
      if(_root.link != 1){
            this.gotoAndPlay("over");
      }
      ;
}
on (releaseOutside, rollOut) {
      if(_root.link != 1){
            this.gotoAndPlay("out");
      }
      ;
}
on (release) {
      
      ;
}
-----------------------------------------------------------

As you can see on realase is empty...I need to call an external swf with the following code:

------------------------------------------
on (release) {
      if (_root.currMovie == undefined) {
            _root.currMovie = "section2";
            container.loadMovie("section2.swf");
      } else if (_root.currMovie != "section2") {
            if (container._currentframe>= container.midframe) {
                  _root.currMovie = "section2";
                  container.play();
            }
      }
}
-----------------------------------------

But it doesnt let me call it...nothing happens..the animation does work...but it doesnt call the swf...i have 2 other codes that can call the swf in another way but I need the realease code above to make work the container feauture *which is letting me call swf's and having each one run a few more frames before it exists.  Here are the 2 other codes i usually use to call external swfs but in this case they work..but doesnt let me tell each swf to run a few more frames before it exists.

1.  _root.createEmptyMovieClip ("mc_loader", _root.getNextHighestDepth ());
        _root.mc_loader.loadMovie ("menu.swf");
            
2.  var tmp:MovieClip = _root.createEmptyMovieClip("clip_instance", getNextHighestDepth());
tmp.loadMovie("musician.swf");
johanwilchesAsked:
Who is Participating?
 
Aneesh ChopraCommented:
Here is the updated code:

Code for Welcome Button onRelease
-----------
on (release) {
      if (_root.currMovie != "welcome" && _root.container._currentframe<_root.container._totalframes)
      {
            _root.currMovie = "welcome";
            _root.container.play();
      }
}
----------------

Code for Company Button onRelease
-----------
on (release) {
      if (_root.currMovie != "company" && _root.container._currentframe<_root.container._totalframes)
      {
            _root.currMovie = "company";
            _root.container.play();
      }
}
----------------

Rgds
Aneesh
0
 
ivan_osCommented:
Hi,
since you say buttons are inside movieClips, then you might experience scope problems with calling container from on(release).
Try not to call container.loadMovie but _parent.container.loadMovie or even better _root.container.loadMovie ...
That's what comes to my mind from reading your post. For more detailed help , fla. would be nice :o)

Regards,
ivan_os
0
 
johanwilchesAuthor Commented:
thanks for the help Ivan..tried to change to _parent.container...and _root.container...and didnt work...ive uploaded the fla's to the server...the main file is: menu...where i have the buttons to call the external swfs...ive placed to externals..*welcome* and *company profile* which will load on by clickin on any of the buttons.


http://www.fordrickhomes.com/test.zip

0
 
Dushan De SilvaTechnology ArchitectCommented:
You can simply do with your coding, if you use "levels" , when your using loadMovie and unloadMovie function.

BR Dushan
0
 
johanwilchesAuthor Commented:
Thanks guys..aneesh the updated code worked perfect...sorry to bother again but im about to post a new question regarding this since i have a main movie where im goin to be calling this menu and is not letting me call the swfs again...it must be again the levels/roots but im having a hard time to figure out how to use levels/roots...thanks again...

cheers,

Johan,
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.