myatia
Programmer
- Nov 21, 2002
- 232
Hi,
I'm trying to use setProperty to set the height of a movie clip. I do this by adding a specified number of pixels, heightInterval, to the current height. However, this only works when heightInterval is set to 1 or 5; otherwise, the movie clip's height just says the same. If anyone has any advice, please let me know. The code I'm working on is below, if it helps...
Thanks,
Misty
I'm trying to use setProperty to set the height of a movie clip. I do this by adding a specified number of pixels, heightInterval, to the current height. However, this only works when heightInterval is set to 1 or 5; otherwise, the movie clip's height just says the same. If anyone has any advice, please let me know. The code I'm working on is below, if it helps...
Thanks,
Misty
Code:
// My code only works if I have this set to 1 or 5.
var heightInterval = 5;
function growBar() {
// Current height of the rectangle
var h = getProperty(_root.theMovie, _height);
// Add heightInterval pixels to the rectangle's height
setProperty(_root.theMovie, _height, h + heightInterval);
}
_root.frame = 0;
// Add heightInterval pixels to the movie's height
// every 50 milliseconds.
_root.intervalID = setInterval(growBar(), 50);