PDA

View Full Version : hitTest - sweating effect


texbala
04-01-2003, 06:17 PM
I am trying to create a sweating effect with a hitTest method for a title banner...


//var countSeconds = setInterval(increaseSeconds, 1000);
for (i=1; i<7; i++) {
duplicateMovieClip(_root.title_mc.sweatTitle, sweat+i, i);
setProperty("sweat"+[i], _x, i+20);
setProperty("sweat"+[i],_y, i+20);
}
function increaseY(mc) {
mc._y++;
}
this.onEnterFrame = function() {
//trace(_root.title_mc.sweatTitle._y);
increaseY(_root.title_mc.sweatTitle);
if (_root.title_mc.sweatTitle.hitTest(_root.title_mc. titleName)) {
increaseYScale(_root.title_mc.sweatTitle);
delete this.onEnterFrame;

//trace("hit");
}
};
function increaseYScale(mc){
if(mc._yscale <200)
mc._yscale++;
}
//inside 'title_mc' movieclip are 'sweatTitle' - the sweat and 'titleName' - the title


am not able to set the property of the duplicated movies...
also can I do an effect method other than this??

attached is a sample file!!

thnx!!

Jesse
04-01-2003, 10:31 PM
Your setProperty code is incorrect. Please see the Advanced Pathing tutorial. It should be more like this:
setProperty(_root.title_mc["sweat"+i], _x, i+20);