Visualizzazione dei risultati da 1 a 4 su 4

Discussione: movimento

  1. #1

    movimento

    Ciao a tutti, ho un problema con lo script del movimento.
    Su due clip a forma di freccia che indicano sù e giù ho rispettivamente i seguenti script:

    onClipEvent (mouseDown) {
    if(this.hitTest(_root._xmouse, _root._ymouse, true)){
    this.premuto = true;
    }
    }
    onClipEvent (mouseUp) {
    this.premuto = false;
    }
    onClipEvent (enterFrame) {
    if (this.premuto) {
    this._parent.immag._y += 10;
    }
    }



    onClipEvent (mouseDown) {
    if(this.hitTest(_root._xmouse, _root._ymouse, true)){
    this.premuto = true;
    }
    }
    onClipEvent (mouseUp) {
    this.premuto = false;
    }
    onClipEvent (enterFrame) {
    if (this.premuto) {
    this._parent.immag._y -= 10;
    }
    }

    io dovrei dare un limite all'area dell'immagine in modo tale che quando si arriva alla fine dell'immagine il movimento si blocchia sia andando sù e sia andando giù!
    Chissà se mi son spiegata bene?
    Grazie mille!

  2. #2
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479
    codice:
    onClipEvent (mouseDown) { 
    	if(this.hitTest(_root._xmouse, _root._ymouse, true)){ 
    		this.premuto = true; 
    	} 
    } 
    onClipEvent (mouseUp) { 
    	this.premuto = false; 
    } 
    onClipEvent (enterFrame) { 
    	if (this.premuto && this._parent.immag._y < limite_verso_il_basso) {
    		this._parent.immag._y += 10; 
    	} 
    } 
    
    
    
    onClipEvent (mouseDown) { 
    	if(this.hitTest(_root._xmouse, _root._ymouse, true)){ 
    		this.premuto = true; 
    	} 
    } 
    onClipEvent (mouseUp) { 
    	this.premuto = false; 
    } 
    onClipEvent (enterFrame) { 
    	if (this.premuto&& this._parent.immag._y > limite_verso_l_alto) { 
    		this._parent.immag._y -= 10; 
    	} 
    }

  3. #3
    ...ma come al solito grazie mille!!!!!!!!

  4. #4
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479
    Di niente..

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.