S
sevY
Hi zusammen,
a short one…
Wenn ihr MovieClips mit Geraden verbinden wollt, geht das ganz einfach mit folgendem Script:
Damit kann man dann hinterher noch nette Animationen basteln… zb. die MovieClips anfassen und durch die Gegend ziehen… sieht verrückt aus…
Oder noch schlimmer… einfach alles zufällig durch die Gegend wirbeln lassen bis irgendwann die Performance im Keller ist, da alles vollgekritzelt wurde…
Liebe Grüße
Yves
a short one…
Wenn ihr MovieClips mit Geraden verbinden wollt, geht das ganz einfach mit folgendem Script:
PHP:
//Actionscript 1.0
MovieClip.prototype.draw=function(x,y,lineSize,colour,alpha)
{
this.lineStyle (lineSize, colour, alpha);
with(this)
{
lineTo(x, y);
}
};
_root.mc1.draw(_root.mc2._x-_root.mc1._x,_root.mc2._y-_root.mc1._y,2,'0xff0000',60);
_root.mc2.draw(_root.mc3._x-_root.mc2._x,_root.mc3._y-_root.mc2._y,2,'0xff0000',60);
Damit kann man dann hinterher noch nette Animationen basteln… zb. die MovieClips anfassen und durch die Gegend ziehen… sieht verrückt aus…
PHP:
//Actionscript 1.0
MovieClip.prototype.draw=function(x,y,lineSize,colour,alpha)
{
this.lineStyle (lineSize, colour, alpha);
with(this)
{
lineTo(x, y);
}
};
this.onEnterFrame=function()
{
_root.mc1.draw(_root.mc2._x-_root.mc1._x,_root.mc2._y-_root.mc1._y,2,'0xff0000',60);
_root.mc2.draw(_root.mc3._x-_root.mc2._x,_root.mc3._y-_root.mc2._y,2,'0xff0000',60);
}
_root.mc1.onPress=function()
{
this.startDrag();
}
_root.mc2.onPress=function()
{
this.startDrag();
}
_root.mc3.onPress=function()
{
this.startDrag();
}
_root.mc1.onRelease=function()
{
this.stopDrag();
}
_root.mc2.onRelease=function()
{
this.stopDrag();
}
_root.mc3.onRelease=function()
{
this.stopDrag();
}
Oder noch schlimmer… einfach alles zufällig durch die Gegend wirbeln lassen bis irgendwann die Performance im Keller ist, da alles vollgekritzelt wurde…
PHP:
MovieClip.prototype.draw=function(x,y,lineSize,colour,alpha)
{
this.lineStyle (lineSize, colour, alpha);
with(this)
{
lineTo(x, y);
}
};
this.onEnterFrame=function()
{
_root.mc1.draw(_root.mc2._x-_root.mc1._x,_root.mc2._y-_root.mc1._y,2,'0xff0000',60);
_root.mc2.draw(_root.mc3._x-_root.mc2._x,_root.mc3._y-_root.mc2._y,2,'0xff0000',60);
_root.mc1._x=random(400);
_root.mc1._y=random(200);
_root.mc2._x=random(400);
_root.mc2._y=random(200);
_root.mc3._x=random(400);
_root.mc3._y=random(200);
}
Liebe Grüße
Yves