Показать сообщение отдельно
Старый 02.11.2007, 17:06
Ostgur вне форума Посмотреть профиль Отправить личное сообщение для Ostgur Посетить домашнюю страницу Ostgur Найти все сообщения от Ostgur
  № 5  
Ответить с цитированием
Ostgur
 
Аватар для Ostgur

Регистрация: Apr 2004
Адрес: macromedia—adobe Любит: Flash MX
Сообщений: 2,860
Код:
var cube_count = 0; //кол-во кубов

//фун-ция создачи куба
this.createCude = function(x1, y1, witdh, len, c1, c2){ 
this.createEmptyMovieClip("cube"+cube_count, this.getNextHighestDepth());
with (this.cube+cube_count) {
	lineStyle(20, "0x"+c1, 100, true, "none", "round", "round", 1);
	beginFill("0x"+c1);
	moveTo(x1, y1);
    lineTo(x1+witdh+len, y1);
    lineTo(x1+witdh+len, y1+witdh+len);
	lineTo(x1, y1+witdh+len);
	endFill();
}

with (this.cube+cube_count) {
	lineStyle(20, "0x"+c2, 100, true, "none", "round", "round", 1);
	beginFill("0x"+c2);
	moveTo(x1+len, y1+len);
    lineTo(x1+witdh+len, y1+len);
    lineTo(x1+witdh+len, y1+witdh+len);
	lineTo(x1+len, y1+witdh+len);
	endFill();
}
}

//создаём куб
_root.createCude(100,150,50,5,"FD2DFD","C002C1"); //createCude(начальная_x, начальная_y, сторона, глубина, цвет1, цвет2);