?
Solved

button code inside a movieclip not letting call an external swf

Posted on 2006-03-23
5
Medium Priority
?
276 Views
Last Modified: 2012-06-21
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");
0
Comment
Question by:johanwilches
5 Comments
 
LVL 9

Expert Comment

by:ivan_os
ID: 16274759
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
 

Author Comment

by:johanwilches
ID: 16275166
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
 
LVL 34

Accepted Solution

by:
Aneesh Chopra earned 2000 total points
ID: 16276607
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
 
LVL 17

Expert Comment

by:Dushan De Silva
ID: 16276669
You can simply do with your coding, if you use "levels" , when your using loadMovie and unloadMovie function.

BR Dushan
0
 

Author Comment

by:johanwilches
ID: 16276790
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

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question