wasp007
03-27-2003, 05:03 PM
how would i put a 2 second delay between these two functions
during the end of function open() it runs function motion2()
i need to put 2 pause before function motion2 is ran see below
function open(){
_root.content_mc.folders.slidingObject_mc.onEnterF rame = function() {
if (_root.running && Math.abs(_root.content_mc.folders.marker_mc_x-_root.content_mc.folders.slidingObject_mc._x)&& Math.abs(_root.content_mc.folders.marker_mc._y-this._y) && Math.abs(_root.content_mc.folders.marker_mc._width-this._width)&& Math.abs(_root.content_mc.folders.marker_mc._heigh t-this._height)<1) {
// set position and hang out
_root.content_mc.folders.slidingObject_mc._x = _root.content_mc.folders.marker_mc._x;
this._y = _root.content_mc.folders.marker_mc._y;
this._width = _root.content_mc.folders.marker_mc._width;
this._height = _root.content_mc.folders.marker_mc._height;
_root.running = false;
} else if (_root.running) {
_root.menu.gotoAndPlay(3);
this._x -= (this._x-_root.content_mc.folders.marker_mc._x)*.5;
this._y -= (this._y-_root.content_mc.folders.marker_mc._y)*.5;
this._width -= (this._width-_root.content_mc.folders.marker_mc._width)*.5;
this._height -= (this._height-_root.content_mc.folders.marker_mc._height)*.5;
//run motion2 function *****need a pause of 2 seconds.
_root.motion2();
} else {
// wait for button press
;
}
};
//end function
}
function motion2(){
_root.content_mc.folders.slidingObject_mc.onEnterF rame = function() {
if (_root.running && Math.abs(_root.content_mc.folders.marker_motion2_m c_x-_root.content_mc.folders.slidingObject_mc._x)&& Math.abs(_root.content_mc.folders.marker_motion2_m c._y-this._y) && Math.abs(_root.content_mc.folders.marker_motion2_m c._width-this._width)&& Math.abs(_root.content_mc.folders.marker_motion2_m c._height-this._height)<1) {
// set position and hang out
_root.content_mc.folders.slidingObject_mc._x = _root.content_mc.folders.marker_motion2_mc._x;
this._y = _root.content_mc.folders.marker_motion2_mc._y;
this._width = _root.content_mc.folders.marker_motion2_mc._width;
this._height = _root.content_mc.folders.marker_motion2_mc_height;
_root.running = false;
} else if (_root.running) {
_root.menu.gotoAndPlay(3);
this._x -= (this._x-_root.content_mc.folders.marker_motion2_mc._x)*.5;
this._y -= (this._y-_root.content_mc.folders.marker_motion2_mc._y)*.5;
this._width -= (this._width-_root.content_mc.folders.marker_motion2_mc._width) *.5;
this._height -= (this._height-_root.content_mc.folders.marker_motion2_mc._height )*.5;
} else {
// wait for button press
;
}
};
//end function
}
during the end of function open() it runs function motion2()
i need to put 2 pause before function motion2 is ran see below
function open(){
_root.content_mc.folders.slidingObject_mc.onEnterF rame = function() {
if (_root.running && Math.abs(_root.content_mc.folders.marker_mc_x-_root.content_mc.folders.slidingObject_mc._x)&& Math.abs(_root.content_mc.folders.marker_mc._y-this._y) && Math.abs(_root.content_mc.folders.marker_mc._width-this._width)&& Math.abs(_root.content_mc.folders.marker_mc._heigh t-this._height)<1) {
// set position and hang out
_root.content_mc.folders.slidingObject_mc._x = _root.content_mc.folders.marker_mc._x;
this._y = _root.content_mc.folders.marker_mc._y;
this._width = _root.content_mc.folders.marker_mc._width;
this._height = _root.content_mc.folders.marker_mc._height;
_root.running = false;
} else if (_root.running) {
_root.menu.gotoAndPlay(3);
this._x -= (this._x-_root.content_mc.folders.marker_mc._x)*.5;
this._y -= (this._y-_root.content_mc.folders.marker_mc._y)*.5;
this._width -= (this._width-_root.content_mc.folders.marker_mc._width)*.5;
this._height -= (this._height-_root.content_mc.folders.marker_mc._height)*.5;
//run motion2 function *****need a pause of 2 seconds.
_root.motion2();
} else {
// wait for button press
;
}
};
//end function
}
function motion2(){
_root.content_mc.folders.slidingObject_mc.onEnterF rame = function() {
if (_root.running && Math.abs(_root.content_mc.folders.marker_motion2_m c_x-_root.content_mc.folders.slidingObject_mc._x)&& Math.abs(_root.content_mc.folders.marker_motion2_m c._y-this._y) && Math.abs(_root.content_mc.folders.marker_motion2_m c._width-this._width)&& Math.abs(_root.content_mc.folders.marker_motion2_m c._height-this._height)<1) {
// set position and hang out
_root.content_mc.folders.slidingObject_mc._x = _root.content_mc.folders.marker_motion2_mc._x;
this._y = _root.content_mc.folders.marker_motion2_mc._y;
this._width = _root.content_mc.folders.marker_motion2_mc._width;
this._height = _root.content_mc.folders.marker_motion2_mc_height;
_root.running = false;
} else if (_root.running) {
_root.menu.gotoAndPlay(3);
this._x -= (this._x-_root.content_mc.folders.marker_motion2_mc._x)*.5;
this._y -= (this._y-_root.content_mc.folders.marker_motion2_mc._y)*.5;
this._width -= (this._width-_root.content_mc.folders.marker_motion2_mc._width) *.5;
this._height -= (this._height-_root.content_mc.folders.marker_motion2_mc._height )*.5;
} else {
// wait for button press
;
}
};
//end function
}