Ver Mensaje Individual
  #5 (permalink)  
Antiguo 09/01/2009, 06:08
Stranyer
 
Fecha de Ingreso: junio-2006
Mensajes: 45
Antigüedad: 20 años, 3 meses
Puntos: 0
Respuesta: [basico] modificar variable

Cita:
Iniciado por gabiango Ver Mensaje
estas cambiando la variable altura, pero no la posición del clip. tienes definida una variable llamada posi que supongo se refiere a la posicion del clip.
Si, es la posicion del clip pero supuestamente con
Código:
sig_btn.onPress = function() {
	
	altura = altura + 390;
	}

le sumo a altura, que a su vez le resta a Stage.height...

El valor que tiene la posicion del clip se supone que lo determina "posi".

Esta mal lo que digo?



Dejo la function completa, para que comprendas la estructura de la misma:


Código PHP:
T=0
    R
=00

function byggBilder()
{
    
i = 0;
     
        
    if (
photoHolder.length < prueba2_txt.text) {
        
        
prueba2_txt.text = photoHolder.length
    
}
    
    while (
i < prueba2_txt.text)
    
    
    
    
    {
       
        
mc = _root.attachMovie("fotoHolder", "fotoHolder" + i, _root.getNextHighestDepth(), {_xscale: thumbStr, _yscale: thumbStr, _rotation: 30 - 60 * Math.random()});
        
mc.txt.text = photoHolder[i].desc;
        
mc.txt1.text = photoHolder[i].url;
        
        if (
Math.round(Math.random() * 1) == 1) 
        {
            
mc._y = Stage.height * Math.random() + mc._height * 2;
            if (
Math.round(Math.random() * 1) == 1) 
            {
                
mc._x = Stage.width + mc._width * 2;
            }
            else 
            {
                
mc._x = 0 - mc._width * 2;
            }
        }
        else 
        {
            
mc._x = Stage.width * Math.random() + mc._width * 2;
            if (
Math.round(Math.random() * 1) == 1) 
            {
                
mc._y = Stage.height + mc._height * 2;
            }
            else 
            {
                
mc._y = 0 - mc._height * 2;
            }
        }
        
        
        
//aca comienza lo agregado
        
var altura = 10
        posi 
= Stage.height - altura
        
        T
=T+1
        
        
if (T > 4){
            
T=0 + 1
            R
=R+160
        
}
        
        
mc.newX = Math.round((mc._width/2) + (Stage.width - 200 - mc._width))+T*170-700;
        
mc.newY = Math.round((mc._height/2) + (posi - mc._height-R));
        
        
        
        
        
        
        
        
sig_btn.onPress = function() {
        
altura = altura -400
        
    
}

        
//aca termina
        
        
        
       // mc.newX = Math.round(mc._width / 2 + (Stage.width -230 - mc._width) * Math.random());
        //mc.newY = Math.round(mc._height / 2 + (Stage.height - mc._height) * Math.random());
        
mc.oldRotation = mc._rotation;
        
mc.oldX = mc.newX;
        
mc.oldY = mc.newY;
        
mc.startX = mc._x;
        
mc.startY = mc._y;
        
mc.oldHeight = mc._yscale;
        
mc.oldWidth = mc._xscale;
        
mc.id = i;
        
mc.onEnterFrame = fotoAnimer;
        
mc.filters = [fotoSkygge];
        
mc.dragPol.onPress = drag;
        
mc.dragPol.onReleaseOutside = mc.dragPol.onRelease = stopdrag;
        
photoHolder[i].mc = mc;
        
lastBilde(mc, photoHolder[i].url);
        
delete mc;
        ++
i;
    }
    
antallBilder = i;
} 

Última edición por Stranyer; 09/01/2009 a las 06:21