Hey everyone, I just posted earlier about loading a movie dynamically, well I have figured out how to do this but my code only works once! I have three MC’s: The Link(home), Transition(the preloader), and content. Now when I click the button it sets a global variable and starts the transition, Here is the code for the transition…
stop();
onEnterFrame = function () {
loaded=_root.content.getBytesLoaded();
total=_root.content.getBytesTotal();
if (loaded == total) {
_root.transition.gotoAndPlay("Out");
loaded="";
total="";
} else if (loaded != total) {
getPercent = loaded/total;
_root.transition.loadText = Math.round(getPercent*100)+"%";
_root.transition.loadBar._width = getPercent*150;
}
}
_root.content.loadMovie(_global.MyMovie, _root.content);
and here is the code on the button at the moment:
hit.onPress = function () {
_global.MyMovie="Home.swf";
_root.transition.gotoAndPlay("go");
}
It works the first time, but if I click the about link, with the same code (except it defines the _global variable as “About.swf”) nothing happens, like it only runs once and stops…
Thanks in advance
Fidelity88