View all comments

Comments for present number 599

5992006--0-3-, 08. 0

color please!

j

5992006--0-3-, 08. 0

Color later!

Not the prettiest code, but it works:

___________________

var count = 0;
var j = 1;
var kleur = 0xFFFFFF;
var alph = 5;
var w;
var h;

_root.onMouseDown = function(){
//declare xpos and ypos at the start
var xpos1:Number = _root._xmouse;
var ypos1:Number = _root._ymouse;

var xpos2:Number = 500 - _root._xmouse;
var ypos2:Number = _root._ymouse;

var xpos3:Number = 500 - _root._xmouse;
var ypos3:Number = 500 - _root._ymouse;

var xpos4:Number = _root._xmouse;
var ypos4:Number = 500 - _root._ymouse;


for(i = _root.count; i < _root.count + 4; i++){
_root.createEmptyMovieClip("mc" + i,i);
mc = _root["mc" + i];
//mc.blendMode = 7;
//trace(mc);
mc.num = j;
mc._x = eval("xpos" + j);
mc._y = eval("ypos" + j);

//trace(mc._x);
//trace(mc._y);

switch (mc.num) {

case 1 :
mc.onEnterFrame = function(){
_root.w = _root._xmouse - this._x;
_root.h = _root._ymouse - this._y;
//trace(w);
//trace(h);
this.clear();
this.beginFill(_root.kleur,_root.alph);
this.moveTo(0,0);
this.lineTo(w,0);
this.lineTo(w,h);
this.lineTo(0,h);
this.lineTo(0,0);
this.endFill();
}
break;

case 2 :
mc.onEnterFrame = function(){
var w:Number = _root._xmouse - this._x;
var h:Number = _root._ymouse - this._y;

this.clear();
this.beginFill(_root.kleur,_root.alph);
this.moveTo(0,0);
this.lineTo(0 - _root.w,0);
this.lineTo(0 - _root.w,h);
this.lineTo(0,h);
this.lineTo(0,0);
this.endFill();
}
break;

case 3 :
mc.onEnterFrame = function(){
var w:Number = _root._xmouse - this._x;
var h:Number = _root._ymouse - this._y;

this.clear();
this.beginFill(_root.kleur,_root.alph);
this.moveTo(0,0);
this.lineTo(0 - _root.w,0);
this.lineTo(0 - _root.w,0 - _root.h);
this.lineTo(0,0 - _root.h);
this.lineTo(0,0);
this.endFill();
}
break;

case 4 :
mc.onEnterFrame = function(){
var w:Number = _root._xmouse - this._x;
var h:Number = _root._ymouse - this._y;

this.clear();
this.beginFill(_root.kleur,_root.alph);
this.moveTo(0,0);
this.lineTo(_root.w,0);
this.lineTo(_root.w,0 - _root.h);
this.lineTo(0,0 - _root.h);
this.lineTo(0,0);
this.endFill();
}
break;

}
_root.j++;
//trace(j);
}
}

_root.onMouseUp = function(){
for(i = _root.count; i < _root.count + 4; i++){
mc = _root["mc" + i];
delete mc.onEnterFrame;
switch(mc.num){
case 1 :
mc.onEnterFrame = function(){
this._rotation -= 1;
}
break;
case 2 :
mc.onEnterFrame = function(){
this._rotation += 1;
}
break;
case 3 :
mc.onEnterFrame = function(){
this._rotation -= 1;
}
break;
case 4 :
mc.onEnterFrame = function(){
this._rotation += 1;
}
break;
}

}
_root.count = _root.count + 4;
_root.j = 1;
_root.w = 0;
_root.h = 0;
}

______________

Ellen

5992006--0-3-, 08. 0

As i said, there must be a more elegant way of coding this. This is simply a matter of keeing adding things. No time te make a reset, which is probably not that hard, but you know, just reload the page!

Fun to make all kinds of drawings.. and yeah, its very reminiscent of the snowflakes you saw online a couple of years back.. i know.

lfs,

Ellen