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

Регистрация: Jun 2007
Сообщений: 118
Cool Помогите сделать движение в галерее

Прошу помощи. Чет никак врубиться не могу.
Есть у меня такой код:
Код:
var my_xml:XML = new XML();
my_xml.ignoreWhite = true;

my_xml.onLoad = function(success:Boolean) {
	if (success) {
		var total = my_xml.firstChild.childNodes.length;
    	for (var i=0; i<total; i++) {
			var container:MovieClip = _root.createEmptyMovieClip("cont"+i+"_mc", i);
			var image:MovieClip = container.createEmptyMovieClip("image"+i+"_mc", 1);
			image.loadMovie(my_xml.firstChild.childNodes[i].attributes.small);
			container._x = eval("cont"+(i-1)+"_mc")._x+150;
			container._y = Stage.height/2 - (113/2);
			container.onEnterFrame = mover;
			container.onRollOver = bigger;
			container.onRollOut = smaller;
		}
	}
}

function mover() {
	if (_root._xmouse > Stage.width/2) {
		this._x += speed;
	}
	if (_root._xmouse < Stage.width/2) {
		this._x -= speed;
	}
}

function bigger() {
	this._width = 160;
	this._height = 123;
	this.swapDepths(100);
	this._x -= 5;
	this._y -= 5;
}

function smaller() {
	this._width = 150;
	this._height = 113;
	this.swapDepths(100);
	this._x += 5;
	this._y += 5;
}

my_xml.load("images.xml");
А как сделать чтобы движение происходило бесконечно? Т.е. чтобы лента из картинок была бесконечна?