Foros del Web » Creando para Internet » Flash y Actionscript »

Enviar al frente dinámicamente

Estas en el tema de Enviar al frente dinámicamente en el foro de Flash y Actionscript en Foros del Web. Hola Tengo en un movieclip varias figuras, todas en la misma capa y frame. Lo que necesito hacer es que según el botón que se ...
  #1 (permalink)  
Antiguo 20/08/2006, 16:00
Avatar de Mauri1  
Fecha de Ingreso: noviembre-2002
Ubicación: Santiago de Chile
Mensajes: 558
Antigüedad: 21 años, 5 meses
Puntos: 0
Enviar al frente dinámicamente

Hola

Tengo en un movieclip varias figuras, todas en la misma capa y frame. Lo que necesito hacer es que según el botón que se pulse se envíe una u otra al frente, es decir, que se superponga a las demás figuras, pero sólo sobre las figuras que están en ese clip y no sobre todos los demás clip de la película.

Muchas gracias por su ayuda
  #2 (permalink)  
Antiguo 20/08/2006, 16:54
Avatar de stock  
Fecha de Ingreso: junio-2004
Ubicación: Monterrey NL
Mensajes: 2.390
Antigüedad: 19 años, 9 meses
Puntos: 53
para eso existe la funcion

mc.swapDepths(otroMc);
____________________________________
swapDepths (MovieClip.swapDepths method)

public swapDepths(target:Object) : Void

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

You can extend the methods and event handlers of the MovieClip class by creating a subclass.

Availability: ActionScript 1.0; Flash Player 5

Parameters

target:Object - This parameter can take one of two forms:

A Number that specifies the depth level where the movie clip is to be placed.
A String that specifies the movie clip instance whose depth is swapped with the movie clip for which the method is being applied. Both movie clips must have the same parent movie clip.
Example

The following example swaps the stacking order of two movie clip instances. Overlap two movie clip instances, called myMC1_mc and myMC2_mc, on the Stage and then add the following script to the parent Timeline:

Código PHP:
myMC1_mc.onRelease = function() {
    
this.swapDepths(myMC2_mc);
};
myMC2_mc.onRelease = function() {
    
this.swapDepths(myMC1_mc);
}; 
have funnnnnnn
  #3 (permalink)  
Antiguo 20/08/2006, 16:58
Avatar de Mauri1  
Fecha de Ingreso: noviembre-2002
Ubicación: Santiago de Chile
Mensajes: 558
Antigüedad: 21 años, 5 meses
Puntos: 0
Genial!!, no conocía esa función :P

Muchas gracias stock
  #4 (permalink)  
Antiguo 20/08/2006, 17:01
Avatar de stock  
Fecha de Ingreso: junio-2004
Ubicación: Monterrey NL
Mensajes: 2.390
Antigüedad: 19 años, 9 meses
Puntos: 53
de nada!

have funnnnnnn
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:59.