Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript 1.0/2.0 (http://www.flasher.ru/forum/forumdisplay.php?f=93)
-   -   There is no property with the name 'widthfull_mc' (http://www.flasher.ru/forum/showthread.php?t=98935)

l4p 25.07.2007 03:35

There is no property with the name 'widthfull_mc'
 
Половина кода взял из книжки
Код:

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, ... не нравятся и что они вообще обозначают?? Переменных таких нет в листенге вообще.

Kikasso 25.07.2007 04:39

Нет вообще, вот и ругается. Какой-то мувиклип должен быть. Читайте внимательнее.

CorC 25.07.2007 09:58

Stage? это мувик или вы так к root обращаетесь?
Так нельзя, Stage это отдельный класс и там точно нет методов widthfull_mc и т. д.

Wolsh 25.07.2007 15:33

Интересно в какой книжке такой бред написан?

lowka 25.07.2007 16:10

Код:

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);

Код:

target_mc._x = Math.round((Stage.width - target_mc._width)/2);
target_mc._y = Math.round((Stage.height - target_mc._height)/2);

Минус пропущен.

Kikasso 25.07.2007 16:29

Цитата:

Сообщение от lowka
Минус пропущен.

Блин, вам срочно на TV надо. "Битва экстрассенсов"

Wolsh 25.07.2007 16:33

Ха, ну точно, результат неудачного сканирования.
Автору книги мои извинения :)


Часовой пояс GMT +4, время: 12:04.

Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.