|
-
variable problems...novice.
Alright. Hopefully I can explain this well.
I am trying to reference variables from an external .swf file, which is loaded into a container. The purpose is to use six buttons to load external.swf files into the same container on the stage, at different times. The initial movie loading into the container is a preloader, which should read which button is pressed(by the variables), and then preload the appropriate movie. Long story short the external turns up undefined variables everytime. Here is the preloaders code.
trace(_global.profile);
trace(_global.work);
trace(_global.modules);
trace(_global.reusme);
trace(_global.contact);
trace(_global.signIn);
percent_display = "";
this.createEmptyMovieClip("main_hold", 50);
function movieCheck() {
if (_parent._global.profile == true) {
main_hold.loadMovie("profile_main.swf");
} else if (_global.work == true) {
main.hold.loadMovie("work_main.swf");
} else if (_global.modules == true) {
main.hold.loadMovie("modules_main.swf");
} else if (_global.resume == true) {
main.hold.loadMovie("resume.swf");
} else if (_global.contact == true) {
main_hold.loadMovie("contact_main.swf");
} else if (_global.signIn == true) {
main_hold.loadMovie("signIn_main.swf");
}
};
movieCheck();
this.onEnterFrame = function() {
percent = (this.main_hold.getBytesLoaded()/this.main_hold.getBytesTotal())*100;
if (!isNan(percent)) {
if (percent == 0) {
percent_display = "";
} else {
percent_display = Math.ceil(percent)+"% loaded";
}
container.stop();
} else if (percent == 100 && _global.profile == true) {
delete this.onEnterFrame;
percent_display = "";
loadMovieNum("profile_main.swf", 94);
} else if (percent == 100 && _global.work == true) {
delete this.onEnterFrame;
percent_display = "";
loadMovieNum("work_main.swf", 95);
} else if (percent == 100 && _global.modules == true) {
delete this.onEnterFrame;
percent_display = "";
loadMovieNum("modules_main.swf", 96);
} else if (percent == 100 && _global.resume == true) {
delete this.onEnterFrame;
percent_display = "";
loadMovieNum("resume_main.swf", 97);
} else if (percent == 100 && _global.contact == true) {
delete this.onEnterFrame;
percent_display = "";
loadMovieNum("contact_main.swf", 98);
} else if (percent == 100 && _global.signIn == true) {
delete this.onEnterFrame;
percent_display = "";
loadMovieNum("signIn_main.swf", 99);
}
};
stop();
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|