PDA

View Full Version : Script in a button!!!


hax0r
03-12-2003, 08:37 PM
I have a movie that needs to be loaded into another movie and everytime only two of the buttons stop working they play like a movie up and down up and down below code works in origanal movies but not when loaded from external source.The button is supposed to stay down when pressed.

__________________________________________________


on (release) {
/:pressed1 = /:pressed1+1;
if (/:pressed1 == 3) {
/:pressed1 = 1;
}
if (/:pressed1 == 1) {
tellTarget (_root.shiftleft) {
gotoAndStop("down");
}
tellTarget (_root.shiftright) {
gotoAndStop("down");
}
tellTarget (_root.capslight) {
gotoAndStop("on");
}
//:caps = true;
tellTarget (_root.pop) {
gotoAndPlay(2);
_root.upper.call();
}
/:shiftvar = true;
}
if (/:pressed1 == 2) {
tellTarget (_root.shiftleft) {
gotoAndStop("up");
}
tellTarget (_root.shiftright) {
gotoAndStop("up");
}
tellTarget (_root.capslight) {
gotoAndStop("off");
}
//:caps = false;
//:shiftvar = false
tellTarget (_root.pop) {
gotoAndPlay(6);
_root.lower.call();
}
}
trace("ShiftVar = "+/:shiftvar);
trace("Pressed1 = "+/:pressed1);
}

oldnewbie
03-12-2003, 09:23 PM
You loading in an empty container clip?

If so, some of your references to _root will have to be changed.

If you load on another level, it should work as scripted, as long as you say that this does work on it's own.