Ryall
August 27, 2002, 5:33am
1
here is my final code:
onClipEvent (load) {
speed = Math.random()*3;
}
onClipEvent (enterFrame) {
this._x += speed;
if (this.hitTest(_root.reset)) {
this._x = -300;
speed = Math.random()*3
this._y = Math.random()*76
this._alpha = Math.random()*45
this.xscale = Math.random()100
this.yscale = this.xscale 1.765
}
}
everything works fine EXCEPT the random scalling… any hints??? oh and I have the last line times 1.765 in order to keep proportion of the randomly scaled MC. Please help.
Peace
PS I tried using this too:
mySize=Math.random()100
this.xscale=mySize
this.yscale=mySize 1.765
Thanks
system
August 27, 2002, 5:36am
2
Try…
onClipEvent (load) {
speed = Math.random()*3;
}
onClipEvent (enterFrame) {
this._x += speed;
if (this.hitTest(_root.reset)) {
this._x = -300;
speed = Math.random()*3;
this._y = Math.random()*76;
this._alpha = Math.random()*45;
this._xscale = Math.random()*100;
this._yscale = this._xscale*1.765;
}
}
You forgot to add the _ in front of xscale and yscale
You could also use _width and _height instead of _xscale and _yscale. They do the same thing.
system
August 27, 2002, 5:39am
3
I just caught that!!! ha, its the little things that get you… is height in pixels? or %… thank for all your help!
system
August 27, 2002, 5:41am
4
It is in Pixels.
I hate little coding errors that can make or break your code. One friggin’ symbol is all it takes.