PDA

View Full Version : [FMX] Two sequential functions for one mc



dboers
February 1st, 2004, 08:48 AM
Hi I would like to give two actions to one movie clip. I mean when I push a button a movie clip has to execute two sequential function. The second function has to wait for the first function to complete before it starts.

To see an example click the following link:



Link (http://www.2ndnaturestudio.com/v02/)

Entering the site and clicking on one of the bottom buttons gives the result where I'm looking for.

After the first time clicking on, let's say annoucements, clicking on one of the other buttons is giving the result the the white mask cover the stage and the opens again and an other mc becomes vissible.

ScriptFlipper
February 1st, 2004, 04:39 PM
why don't do like this:


firstFunction = function (nextFunction) {
// do some stuff here
// and then:
if (nextFunction == "secondFunction") {
_root.secondFunction();
} else if (nextFunction == "thirdFunction") {
_root.thirdFunction();
}

};
secondFunction = function () {
// do some stuff here
};
thirdFunction = function () {
// do some stuff here
};

button1.onRelease = function() {
_root.firstFunction(secondFunction);
};
button2.onRelease = function() {
_root.firstFunction(thirdFunction);
};

dboers
February 1st, 2004, 05:29 PM
Hi,

This is a very helpful tip.

Thank you:beard:

ScriptFlipper
February 2nd, 2004, 11:12 AM
Sure, no problem!