Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript (http://www.flasher.ru/forum/forumdisplay.php?f=5)
-   -   attachMovie() внутри мувиклипа (http://www.flasher.ru/forum/showthread.php?t=62631)

p1ma 01.09.2004 13:52

attachMovie() внутри мувиклипа
 
Работает ли attachMovie() внутри муви клипа ?

-----------
menu_2 = new Array ();
for (w=1;w<=10;w++) {
sy+=21;
menu_2[w]=_root.attachMovie("button", "butt"+w, depth2++);
menu_2[w]._y=sy;
menu_2[w]._x=220;
}
------------

iNils 01.09.2004 14:06

А что значит?

menu_2[w]=_root.attachMovie("button", "butt"+w, depth2++);


:)))

p1ma 01.09.2004 14:10

В смысле ? =(

iNils 01.09.2004 14:15

Ты читал в хелпе описание attachMovie? Если читал то должен был заметить, что данный метод ничего не возвращает.

А ты пытаешь его присвоить какойто переменной )))

Вернее засунуть в массив не понятно что, да еще этому массиву координаты задать.

p1ma 01.09.2004 14:16

Он возвращает путь к мувику

dimarik 01.09.2004 14:16

p1ma создает ссылки на мувик, которые хранятся в массиве menu_2.

iNils 01.09.2004 14:17

Цитата:

p1ma создает ссылки на мувик, которые хранятся в массиве menu_2.
А зачем это в массиве хранить?

p1ma 01.09.2004 14:18

Да, но вопрос - почему это не работает внутри мувика ?

dimarik 01.09.2004 14:18

Код:

MovieClip.attachMovie()
Availability
Flash Player 5.

Usage
my_mc.attachMovie(idName, newName, depth [, initObject])

Parameters
idName The linkage name of the movie clip symbol in the library to attach to a movie clip on the Stage. This is the name entered in the Identifier field in the Linkage Properties dialog box.

newname A unique instance name for the movie clip being attached to the movie clip.

depth An integer specifying the depth level where the SWF file is placed.

initObject (Supported for Flash Player 6 and later) An object containing properties with which to populate the newly attached movie clip. This parameter allows dynamically created movie clips to receive clip parameters. If initObject is not an object, it is ignored. All properties of initObject are copied into the new instance. The properties specified with initObject are available to the constructor function. This parameter is optional.

Returns
A reference to the newly created instance.


Description
Method; takes a symbol from the library and attaches it to the SWF file on the Stage specified by my_mc. Use removeMovieClip() or unloadMovie() to remove a SWF file attached with attachMovie().

Example
The following example attaches the symbol with the linkage identifier "circle" to the movie clip instance, which is on the Stage in the SWF file.

on (release) {
    thing.attachMovie( "circle", "circle1", 2 );
}

See also
MovieClip.removeMovieClip(), MovieClip.unloadMovie(), Object.registerClass(), removeMovieClip()


p1ma 01.09.2004 14:19

for (w=1;w<=10;w++) { }

Потому что их 10ть
И с ними потом тоже надо что то делать


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

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