PDA

View Full Version : passing variables


kid_unknown
03-29-2003, 04:10 PM
howdy

i have three swf's main, nav, and window now what im tring to do is when a button is clicked in nav set variable in root i have this action, not sure if its right

_root.section="home";

i declared this variable in the main.swf, i have the following code:

section="0"; in the first frame of main

now when i click the button in nav as well as sending the variable to _root i get it to start anination in window which is doors shutting, when they finally close there is the following actions

if (_root.section == "home") {
loadMovie("pages/home.swf", "_level2.contentwindow.msg");
} else if (_root.section == "work") {
loadMovie("pages/work.swf", "_level2.contentwindow.msg");
} else if (_root.section == "skills") {
loadMovie("pages/skills.swf", "__level2.contentwindow.msg");
} else if (_root.section == "gallery") {
loadMovie("pages/gallery.swf", "_level2.contentwindow.msg");
} else if (_root.section == "contact") {
loadMovie("pages/contact.swf", "_level2.contentwindow.msg");
} else if (_root.section == "msg") {
loadMovie("pages/msg.swf", "_level2.contentwindow.msg");
}

cant seem to get them working, been playing with the code for ages now, pulling my hair out.

thanks in advance

kid_unknown
03-29-2003, 04:41 PM
fixed it, with a litle help.

changed _root.section to _level0.section

kid_unknown
03-29-2003, 10:16 PM
hi again i have this load movie thing sorted now but how do i go about checking if the movie is loaded would this work

add the following action to _level2.contentwindow.msg mc

onClipEvent(data){
_level0.successVar = true;
}

would i also have to unload movie as doors shut?

then too my buttons add

_level0.successVar = false;

and in my window doors have an if statement of somekind to loop until

_level0.successVar == true;


mm im a little confused

any help would be much apreciated

thanks

brian

kid_unknown
03-30-2003, 12:22 AM
sorted it ;)

kid_unknown
03-30-2003, 03:17 PM
mmmmm scratches head

this aint working, added the actions and added 6 big pictures to the first 6 frames of one of the movies to be loaded, when i tested it the preloader worked for the first picture then the doors opened and i could see the other pictures loading one by one slow at first until they had loaded then it flicked through them fast, it looks like something is wrong,

here is what i done:

add the following action to _level2.contentwindow.msg mc

onClipEvent(data){
_level0.successVar = true;
}

then i added this to my buttons

_level0.successVar = false;

on the first frame of my _level0 time line i added

successVar = false;

and lastly to my doors mc i added this loop between the doors closing and opening

if (_level0.successVar == true) {
gotoAndPlay("morphopen");
} else if (_level0.successVar == false) {
gotoAndPlay("loop");
}

cheers