PDA

Volledige versie bekijken : duplicateMovieClip


daniel2909
%Europe/Berlin %443 %2005, 10:38
hey,
alleen duplicateMovieClip werkt niet de rest wel.

mijn (.jpg) komen uit db on clik van een link maar ik wil telkens een copie van dat mc maken zodat ik het op meerdere plekken kan zetten door te slepen....
kan je mij mij nu nog helpen, dan ben ik je alvast dankbaar.

function showcamera(camString) {

_root.createEmptyMovieClip("screen_leftIn1",0);
var mycam = camString.split();
screen_leftIn1.loadMovie(mycam);
screen_leftIn1._x = 3.05;
screen_leftIn1._y = 53.85;

_root.onMouseDown = function(){
//i = i+1;
duplicateMovieClip(_root.screen_leftIn1,"screen_leftIn2",1);

screen_leftIn2.startDrag();
screen_leftIn2._width = 17;
screen_leftIn2._height = 17;
if (screen_leftIn2._droptarget == "/screen_main"){

stopDrag();

}
}
}

Flasher
%Europe/Berlin %624 %2005, 14:59
De naam van de de kopieren MC moet is ook een string, dus met quotes:
duplicateMovieClip("screen_leftIn1","screen_leftIn2",1);
Het is mss makkelijker om de MovieClip.duplicateMovieClip() method te gebruiken in plaats van de standaard functie duplicateMovieClip:

_root.screen_leftIn1.duplicateMovieClip("denieuwenaam",depth);

daniel2909
%Europe/Berlin %638 %2005, 15:20
hoi flasher,
ik heb het op deze manier gedaan maar ik kan steeds de copie daarvan niet zien ik heb zelf voor de copie een nieuwe positie gegeven.
denieuwenaam._x = 40;
denieuwenaam._y = 53;

Flasher
%Europe/Berlin %764 %2005, 18:21
check alle instancenamen ed, en als het dan nog niet werkt..
..post dan je fla

Laiverd
%Europe/Berlin %803 %2005, 19:17
Moeilijk he, die handleiding lezen?! [^]

Description
Method; creates an instance of the specified movie clip while the SWF file is playing. Duplicated movie clips always start playing at Frame 1, no matter what frame the original movie clip is on when the duplicateMovieClip() method is called. Variables in the parent movie clip are not copied into the duplicate movie clip. Movie clips that have been created using duplicateMovieClip() are not duplicated if you call duplicateMovieClip() on their parent. If the parent movie clip is deleted, the duplicate movie clip is also deleted. If you have loaded a movie clip using MovieClip.loadMovie() or the MovieClipLoader class, the contents of the SWF file are not duplicated. This means that you cannot save bandwidth by loading a JPEG or SWF file and then duplicating the movie clip.

Je zult dus voor ieder duplicaat opnieuw een loadMovie() moeten doen.

John