Toon posts:

[flash] actionscripting z-index

Pagina: 1
Acties:

Verwijderd

Topicstarter
Kan je van bepaalde instaties van een movie clip ook een z-index meegeven? Nu is het zo, dat degene die als eerste gemaakt wordt, 'onderop' komt te liggen, maar ik wil dit kunnen aanpassen.

anybody?

Verwijderd

Neem aan dat je het nu hebt over duplicaten van een movieclip, een maniertje zou zijn als je 1000 mc's zou duplicaten en je wilt de eerste het hoogst hebben en de duizendste het laagst:

bij het duplicaten:
code:
1
2
3
for (i=1; i<=1000; i++) {
    _root.mc.duplicateMovieClip("mc_" add i,1000-i);
}

dan kun je het movieclipje zelf nog veranderen van hoogte door te werken met this.swapDepths(level);

hoop dat je dit zoon beetje bedoeld...

Verwijderd

ja hoor, in flash 5 noemen we de z-index de depth.....en dit is een knipsel uit de as(F1!!) library:
MovieClip.swapDepths

Syntax
-------
anyMovieClip.swapDepths(depth);
anyMovieClip.swapDepths(target);

Arguments
---------
target The movie clip instance whose depth that is being swapped by the instance specified in anyMovieClip. Both instances must have the same parent movie clip.

depth A number specifying the depth level where the anyMovieClip is to be placed.

Description
------------
Method; swaps the stacking, or z, order (depth level) of the specified instance with the movie specified by the target argument, or with the movie that currently occupies the depth level specified in the argument. Both movies must have the same parent movie clip. Swapping the depth level of movie clips has the effect of moving one movie in front of or behind the other. If a movie is tweening when this method is called, the tweening is stopped.

Player

Flash 5 or later.

See also

Verwijderd

Topicstarter
thnx guys! Als je naar het verkeerde woord zoekt, wil het idd niet lukken :)