![]() |
|
||||||||||
|
|
|
|||||
|
Регистрация: Jan 2007
Сообщений: 302
|
Есть анимированый мувик на нём указал три положения:
on(rollOver)
{
this.gotoAndPlay(2);}
on(rollOut)
{
this.gotoAndPlay(3);
}
on(press)
{
this.gotoAndPlay(4);
}
portfolioInfo = new XML();
portfolioInfo.ignoreWhite = true;
timeline = this;
baseurl = _url.substr(0, _url.lastIndexOf("/")+1);
portfolioInfo.onLoad = function() {
portfolioTag = this.firstChild;
(count=portfolioTag.childNodes.length);
for (child=0; child<count; child++) {
currentPicture = portfolioTag.childNodes[child];
currentThumb = menu_mc.createEmptyMovieClip("thumbnail"+child, child);
currentThumb._x = child*40;
image = currentThumb.createEmptyMovieClip("thumbnail_image", 0);
image.loadMovie(baseurl+currentPicture.attributes.THUMB);
currentThumb.NAME = currentPicture.attributes.NAME;
currentThumb.IMAGE = currentPicture.attributes.IMAGE;
currentThumb.TEXT = currentPicture.attributes.TEXT;
import mx.transitions.Tween;
import mx.transitions.easing.None;
currentThumb.onRollOver = currentThumb.onDragOver=function () {
this.tweenX.stop();
this.tweenY.stop();
this.tweenX = new Tween(this, "_xscale", None.easeNone, this._xscale, 140, 0.3, true);
this.tweenY = new Tween(this, "_yscale", None.easeNone, this._yscale, 140, 0.3, true);
showName_txt.text = this.NAME;
};
currentThumb.onRollOut = currentThumb.onDragOut=function () {
this.tweenX.stop();
this.tweenY.stop();
this.tweenX = new Tween(this, "_xscale", None.easeNone, this._xscale, 100, 0.3, true);
this.tweenY = new Tween(this, "_yscale", None.easeNone, this._yscale, 100, 0.3, true);
showName_txt.text = this.NAME;
showName_txt.text = "";
};
currentThumb.onPress = currentThumb.onDragOver=function () {
image_mc.origDepth = image_mc.getDepth();
image_mc.swapDepths(image_mc._parent.getNextHighestDepth());
mx.transitions.TransitionManager.start(image_mc, {type:mx.transitions.Photo, direction:0, duration:1, easing:mx.transitions.easing.Strong.easeOut, param1:empty, param2:empty});
image_mc.loadMovie(baseurl+this.IMAGE);
info_txt.text = "Loading...";
timeline.loadVariables(baseurl+this.TEXT);
};
}
};
portfolioInfo.load(baseurl+"xmlportfoliowithimageandtext.xml");
Подскажите пожалуйста. |
|
|||||
|
Простой совет: пиши весь код в кадрах.
|
|
|||||
|
Регистрация: Jan 2007
Сообщений: 302
|
Спасибо за совет, - а конкретно по моему вопросу...
|
|
|||||
|
Перпиши нормально код и выложи исходник, тогда будет виднее.
|
|
|||||
|
Et cetera
Регистрация: Sep 2002
Сообщений: 30,787
|
Для начала неплохо было бы узнать, куда ссылается this в on(press).
|
|
|||||
|
Регистрация: Jan 2007
Сообщений: 302
|
Цитата:
on(rollOver) on(rollOut) on(press) лежат на мувике (тоисть выделил мувик и на нём вставил эти обработчики) все они обращаются к кадрам всередине мувика (мувик состоит из 5 кадров на которых расположена анимация). В 4 кадре я вставил код создания галереи (файл галереи и хмл файл лежат в той же директории). Или там нужно эщё что то добавить чтоб открывался этот файл галереи по нажатию кнопки? |
|
|||||
|
Et cetera
Регистрация: Sep 2002
Сообщений: 30,787
|
Надо забыть про эти обработчики и писать код в кадрах. Точка.
Пока этого не будет, бессмысленно что-либо делать дальше. |
|
|||||
|
Banned
Регистрация: Feb 2007
Адрес: Ростов-на-Дону
Сообщений: 214
|
А ты не мож этот файл галереи просто аттачить из библеотеки при нажатии?
|
|
|||||
|
Регистрация: Apr 2007
Сообщений: 1,369
|
2BM Senya:
А зачем атачить из библиотеки, у него небось куча фоток? Лучше подгружать и прелоадер показывать. |
|
|||||
|
Регистрация: Oct 2006
Адрес: spb.ru
Сообщений: 3,221
|
Вот же __etc пишет:
Цитата:
|
![]() |
![]() |
Часовой пояс GMT +4, время: 03:04. |
|
|
« Предыдущая тема | Следующая тема » |
|
|