Link to home
Start Free TrialLog in
Avatar of johanwilches
johanwilches

asked on

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");
Avatar of ivan_os
ivan_os

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
Avatar of johanwilches

ASKER

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

ASKER CERTIFIED SOLUTION
Avatar of Aneesh Chopra
Aneesh Chopra
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can simply do with your coding, if you use "levels" , when your using loadMovie and unloadMovie function.

BR Dushan
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,