Форум 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)
-   -   loadClip проблема с кодом (http://www.flasher.ru/forum/showthread.php?t=170094)

DjanSan 18.10.2011 14:09

loadClip проблема с кодом
 
Добрый день! ПРоблема в следующем:

Есть код, который сам по себе прекрасно работает
Код AS1/AS2:

stop();
 
var total:Number = 12;
 
var label_list:Array = new Array("041_horizontal_scroller", "042_vertical_scroller", "043_intro", "044_intro", "045_elastic", "046_thumbnail_xml", "047_present", "048_vertical_menu_xml", "049_horizontal_menu_xml", "050_star_effect", "051_star_motion", "052_design");
 
var link_list:Array = new Array("http://www.flashmo.com/preview/flashmo_041_horizontal_scroller", "http://www.flashmo.com/preview/flashmo_042_vertical_scroller", "http://www.flashmo.com/preview/flashmo_043_intro", "http://www.flashmo.com/preview/flashmo_044_intro", "http://www.flashmo.com/preview/flashmo_045_elastic", "http://www.flashmo.com/preview/flashmo_046_thumbnail_xml", "http://www.flashmo.com/preview/flashmo_047_present", "http://www.flashmo.com/preview/flashmo_048_vertical_menu_xml", "http://www.flashmo.com/preview/flashmo_049_horizontal_menu_xml", "http://www.flashmo.com/preview/flashmo_050_star_effect", "http://www.flashmo.com/preview/flashmo_051_star_motion", "http://www.flashmo.com/preview/flashmo_052_design");
 
var goto_list:Array = new Array("logo1", "logo2", "logo3", "logo4", "logo5", "logo6", "logo7", "logo8", "logo9", "logo10", "logo11", "logo12");
 
var radiusX:Number = 330;
var radiusY:Number = 90;
var centerX:Number = 400;
var centerY:Number = 140;
var speed:Number = 0.005;
tn_group_mc._visible = false;
info.text = "";
fm_label.text = "";
 
for (var i = 0; i < total; i++)
{
        var t = tn_group_mc.duplicateMovieClip("tn" + i, i);
        t.tn_mc.gotoAndStop(i + 1);
        t.tn_shadow_mc.gotoAndStop(i + 1);
        t.fm_label = label_list[i];
        t.fm_url = link_list[i];
        t.fm_goto = goto_list[i];
 
        t.angle = i * ((Math.PI * 2) / total);
        t.onEnterFrame = mover;
 
        t.fm_button.onRollOver = function()
        {
                fm_label.text = "Title: " + this._parent.fm_label;
                info.text = "URL: " + this._parent.fm_url;
        };
        t.fm_button.onRollOut = function()
        {
                info.text = "";
                fm_label.text = "";
        };
        t.fm_button.onRelease = function()
        {
                URL(this._parent.fm_url);
                _root.site.gotoAndStop(this._parent.fm_goto);
        };
}
function mover()
{
        this._x = Math.cos(this.angle) * radiusX + centerX;
        this._y = Math.sin(this.angle) * radiusY + centerY;
        var s = this._y / (centerY + radiusY);
        this._xscale = this._yscale = s * 100;
        this.angle += this._parent.speed;
        this.swapDepths(Math.round(this._xscale) + 100);
}
this.onMouseMove = function()
{
        speed = (this._xmouse - centerX) * 0.0001;
};

Как только я подгружаю swf с этим кодом в другую swf c помощью loadclip, то, как мне кажется, перестаёт работать вот эта строка
Код AS1/AS2:

_root.site.gotoAndStop(this._parent.fm_goto);

весь остальной код работает... Помогите, я уже голову сломал...

mooncar 18.10.2011 14:21

Когда ролик загружается в другой, _root'ом для него становится _root ролика-контейнера.
Потому его надо зафиксировать.
Либо в загружаемом
Код AS1/AS2:

this._lockroot = true ;

Либо для контейнера, куда загрузка происходит:
Код AS1/AS2:

container._lockroot = true ;


DjanSan 18.10.2011 14:27

ААААААААААА!!!! Спасибо заработало!!! респект и уважуха!!!!


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

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