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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dushan De SilvaTechnology ArchitectCommented:
You can simply do with your coding, if you use "levels" , when your using loadMovie and unloadMovie function.

BR Dushan
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,
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.