Показать сообщение отдельно
Старый 27.07.2008, 21:34
lakehouse вне форума Посмотреть профиль Отправить личное сообщение для lakehouse Найти все сообщения от lakehouse
  № 1  
Ответить с цитированием
lakehouse

Регистрация: Aug 2002
Сообщений: 51
По умолчанию миграция исходника flash5 - flash8

исходник ведёт себя абсолютно по-разному во флэш 5, 6 и 8.
видимо из-за аттачей из библиотеки и глубин.
как его заставить нормально публиковаться в 8ой версии?

кода мало, он такой:

Код:
var c = 0;
branches = 3
MovieClip.prototype.rand = function(num){
	if (arguments.length == 1) return Math.floor(Math.random()*num) + 1
	return Math.floor(Math.random()*(Math.abs(arguments[1] - num)+1)) + Math.min(num,arguments[1])
}
MovieClip.prototype.Plant = function(count){
	this.attachMovie("stem","stem"+ ++depth,depth)
	clip = this["stem"+ depth]
	clip.level = 1
	clip.stump = this
}
MovieClip.prototype.Grow = function(linker, count){
	for(i=0;i<count;i++){
		stump.attachMovie(linker, linker+ ++stump.depth,stump.depth)
		clip = stump[linker+ stump.depth]
		clip.level = level + 1
		clip.stump = stump
		clip._xscale = clip._yscale =_xscale * .73
		if(i==0){
			clip._rotation = rand(-95,-50)
		}else if(i==1){
			clip._rotation = rand(-45,30)
		}else if(i==2){
			clip._rotation = rand(35,95)
		}
		if(clip.level>5){
			clip._rotation = rand(-125,125)
		}
		angle = (_rotation+90) * Math.PI/180
		clip._x = _x - Math.cos(angle)*.5*_xscale
		clip._y = _y - Math.sin(angle)*.5*_xscale
	}
}
и в библиотеке на символе:

Код:
stop()
if (level < 7) Grow("stem", _root.branches)
else 
Grow("brush", 1)


спасибо
Вложения
Тип файла: zip fractalgrowingtree_mod.zip (9.4 Кб, 58 просмотров)