Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with mc

Status
Not open for further replies.

disfasia

Programmer
Apr 20, 2001
378
CA
i have buttons in an movie that controls another mc. I have the operations perfectly done for opening that window and then i want to reverse that for the roll-out of the mouse. the problem i am having is that i need a command that will help me recognize when the button is entirely loaded. ok, this sounds confusing, but go to


and the top left button, as you will see does everything i told it to do: it has an image when you roll over with a title. you click and the window appears (the mc) and then you roll out, and the window rolls back. the problem, as you will notice is that if you do not click and then roll out the window still rolls back. how can i have the rollback play only if the mc is loaded, otherwise nothing.
thanks in advance
 
Hard to help you without having a look at your code!
Either post it here, make your .fla available, or send me that .fla at oldnewbie@hotmail.com
mywink.gif
ldnewbie
Hope that this
was helpful!
 
No, I'm sorry... That won't work!
You've got to upload (as you would the *.swf) the *.fla of your project to your site so that we can download it!
mywink.gif
ldnewbie
Hope that this
was helpful!
 
try an if statment to conditionalize. so if the "window" is out, the coming in part dosen't play on roll out. dose that make any sense? i can help you with the code if you want, but i to would need to see the fla. For God so loved the world that he gave his one and only son, that whoever believes in him won't die but have everlasting life - Jesus - John 3:16 -
 
Disfasia,
Have a look at this:


Only worked on the top-left button. Got rid of your invisible button around that one which is useless at this point, and as Defrex suggested used 2 conditional statements. One so that the chi sono panel would not re-open on a second press of that button, and a second so that the panel would only close if it was opened.
The code on that button now looks like this:
Code:
on (rollOver) {
    gotoAndStop (2);
}
on (press) {
    // if... To avoid mc restart on second press
    if (_root.selection == "sono") {
        stop ();
    } else {
        tellTarget (_root.mc1) {
            gotoAndPlay (2);
        }
    // tellTarget should be replaced by...
    // _root.mc1.gotoAndPlay (137);

        _root.selection = "sono";
    }
}
on (rollOut) {
    gotoAndStop (1);
    if (_root.mcopened == true) {
        tellTarget ("_root.mc1") {
            gotoAndPlay (137);
        }
    // tellTarget should be replaced by...
    // _root.mc1.gotoAndPlay (137);
    }

    _root.mcopened = false;
    _root.selection = false;
}
Also set these two variables on frame 1 of Scena 1:
Code:
_root.mcopened = false;
_root.selection = false;

There's still a problem with this: on a quick rollout after a press, eventhough the panel is not yet fully extended, it will close from the closing start position, and so you might see a jump in the animation. The only way to counter that would be to use reverse play on the mc so that it closes from the point it as extended to when the rollout occurs.
Might be another problem too if you intended to add buttons on that panel, because as soon as you roll off that top-left button, that panel will close!
mywink.gif
ldnewbie
Hope that this
was helpful!
 
Typo in the above post, the on press action should be:

on (press) {
// if... To avoid mc restart on second press
if (_root.selection == "sono") {
stop ();
} else {
tellTarget (_root.mc1) {
gotoAndPlay (2);
}
// tellTarget should be replaced by...
// _root.mc1.gotoAndPlay (2);

_root.selection = "sono";
}
}
mywink.gif
ldnewbie
Hope that this
was helpful!
 
Thanks a lot for the help! I have been really busy with the disaster in New York...sorry about the delay!

Peace,

disfasia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top