![]() |
|
||||||||||
|
|||||||
|
|
« Предыдущая тема | Следующая тема » |
| Опции темы | Опции просмотра |
|
![]() |
![]() |
|
|||||
|
Половина кода взял из книжки
var padding:Number = 10;
var maxThumbWidth:Number = 75;
var maxThumbHeight:Number = 50;
_global.xPos = padding;
_global.yPos = padding;
_global.numImages = 0;
var thumb_mcl:MovieClipLoader = new MovieClipLoader();
function image(thumbSrc_str:String, fullSrc_str:String):Void {
var holder_mc:MovieClip = this.createEmptyMovieClip("thumb"+_global.numImages+"_mc",
this.getNextHighestDepth());
holder_mc._x = _global.xPos;
holder_mc._y = _global.yPos;
holder_mc.fullImg = fullSrc_str;
holder_mc.createEmptyMovieClip("image_mc", holder_mc.getNextHighestDepth());
thumb_mcl.loadClip(thumbSrc_str, holder_mc.image_mc);
_global.numImages++;
_global.xPos += maxThumbWidth+padding;
}
image("images/t_1.jpg", "images/f_1.jpg");
image("images/t_1.jpg", "images/f_1.jpg");
image("images/t_1.jpg", "images/f_1.jpg");
image("images/t_1.jpg", "images/f_1.jpg");
image("images/t_1.jpg", "images/f_1.jpg");
image("images/t_1.jpg", "images/f_1.jpg");
thumb0_mc.onRollOver = function() {
thumb0_mc._alpha = 90;
};
thumb0_mc.onRollOut = function() {
thumb0_mc._alpha = 100;
};
thumb0_mc.onRelease = function() {
full_mcl.loadClip(this._parent.fullImg_str, full_mc.image_mc);
};
_root.onEnterFrame = function() {
if (frame_left_mc.hitTest(_xmouse, _ymouse)) {
for (i=0; i<_global.numImages; i++)
{
this["thumb"+i+"_mc"]._x -= 5;
}
}
if (frame_right_mc.hitTest(_xmouse, _ymouse)) {
for (i=0; i<_global.numImages; i++)
{
this["thumb"+i+"_mc"]._x += 5;
}
}
};
this.createEmptyMovieClip("full_mc",this.getNextHighestDepth());
full_mc._visible = false;
full_mc.attachMovie("progressBer_mc", "pBar_mc", full_mc.getNextHighestDepth());
full_mc.pBar_mc._x = Math.round((Stage.widthfull_mc.pBar_mc._width)/2);
full_mc.pBar_mc._y = Math.round((Stage.heightfull_mc.pBar_mc._height)/2);
full_mc.pBar_mc.bar_mc._xscale = 0;
full_mc.createEmptyMovieClip("image_mc", full_mc.getNextHighestDepth());
var fullListener:Object = new Object();
fullListener.onLoadStart = function(target_mc:MovieClip){
target_mc._parent._visible = true;
target_mc._parent.pBar_mc.bar_mc._xscale = 0;
};
fullListener.onLoadProgress = function(target_mc:MovieClip, numBytesLoaded:Number, numBytesTotal:Number)
{
target_mc._parent.pBar_mc._xscale = Math.round(numBytesLoaded/numBytesTotal*100);
};
fullListener.onLoadInit = function(target_mc:MovieClip)
{
var border:Number = 10;
var fullWidth:Number = target_mc._width+border;
var fullHeight:Number = target_mc._height+border;
target_mc._x = Math.round((Stage.widthtarget_mc._width)/2);
target_mc._y = Math.round((Stage.heighttarget_mc._height)/2);
new mx.transitions.Tween(target_mc, "_alpha", mx.transitions.easing.Strong.easeOut,0, 100, 2, true);
target_mc.onPress = function()
{
full_mcl.unloadClip(target_mc);
target_mc._parent._visible = false;
};
};
var full_mcl:MovieClipLoader = new MovieClipLoader();
full_mcl.addListener(fullListener);
**Error** Scene=Scene 1, layer=actions, frame=1:Line 57: There is no property with the name 'widthfull_mc'. full_mc.pBar_mc._x = Math.round((Stage.widthfull_mc.pBar_mc._width)/2); **Error** Scene=Scene 1, layer=actions, frame=1:Line 58: There is no property with the name 'heightfull_mc'. full_mc.pBar_mc._y = Math.round((Stage.heightfull_mc.pBar_mc._height)/2); **Error** Scene=Scene 1, layer=actions, frame=1:Line 76: There is no property with the name 'widthtarget_mc'. target_mc._x = Math.round((Stage.widthtarget_mc._width)/2); **Error** Scene=Scene 1, layer=actions, frame=1:Line 77: There is no property with the name 'heighttarget_mc'. target_mc._y = Math.round((Stage.heighttarget_mc._height)/2); Total ActionScript Errors: 4 Reported Errors: 4 Чем ему widthfull_mc, heighthfull_mc, ... не нравятся и что они вообще обозначают?? Переменных таких нет в листенге вообще. |
|
|||||
|
Регистрация: Oct 2006
Адрес: spb.ru
Сообщений: 3,221
|
Нет вообще, вот и ругается. Какой-то мувиклип должен быть. Читайте внимательнее.
|
|
|||||
|
Stage? это мувик или вы так к root обращаетесь?
Так нельзя, Stage это отдельный класс и там точно нет методов widthfull_mc и т. д.
__________________
"We Are The Champions My Friends!" Queen |
|
|||||
|
Нуб нубам
модератор форума
Регистрация: Jan 2006
Адрес: Бердск, НСО
Сообщений: 6,445
|
Интересно в какой книжке такой бред написан?
__________________
Reality.getBounds(this); |
|
|||||
|
Регистрация: Sep 2006
Сообщений: 256
|
full_mc.pBar_mc._x = Math.round((Stage.width - full_mc.pBar_mc._width)/2); full_mc.pBar_mc._y = Math.round((Stage.height - full_mc.pBar_mc._height)/2); |
|
|||||
|
Регистрация: Oct 2006
Адрес: spb.ru
Сообщений: 3,221
|
Цитата:
|
|
|||||
|
Нуб нубам
модератор форума
Регистрация: Jan 2006
Адрес: Бердск, НСО
Сообщений: 6,445
|
Ха, ну точно, результат неудачного сканирования.
Автору книги мои извинения ![]()
__________________
Reality.getBounds(this); |
![]() |
![]() |
Часовой пояс GMT +4, время: 02:45. |
|
|
« Предыдущая тема | Следующая тема » |
| Опции темы | |
| Опции просмотра | |
|
|