Visualizzazione dei risultati da 1 a 4 su 4
  1. #1
    Utente di HTML.it
    Registrato dal
    Jan 2006
    Messaggi
    4

    Da Flash mx a flash 8... lo script non funziona!

    Salve a tutti, ho scaricao un fla che presenta queste caratteristiche associate ad una mc:

    onClipEvent (load) {
    _x = 175
    _y = 175
    x = _x;
    y = _y;
    x_fin = _x;
    y_fin = _y;
    drag = false;
    }
    onClipEvent (enterFrame) {
    if (!drag) {
    diff_x = (diff_x + ((x_fin - x) / 20))/1.1;
    diff_y = (diff_y + ((y_fin - y) / 20))/1.1;
    x += diff_x;
    y += diff_y;
    _x = x;
    _y = y;
    if(y >= 310){
    y = 310
    }
    }
    }

    onClipEvent (mouseDown) {
    if (hitTest(_root._xmouse, _root._ymouse)) {
    drag = true;
    startDrag (this, true);
    }
    }

    onClipEvent (mouseUp) {
    x = _x;
    y = _y;
    drag = false;
    stopDrag();
    }

    questo script serve a far ritornare in posizione un oggetto draggato.

    se esporto in flash mx funziona, se esporto in flash 8 invece non mi dà l'effetto
    qualcuno può aiutatarmi a convertire il codice per farlo funzionare anche in flash 8

    Grazie mille

  2. #2
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479
    codice:
    onClipEvent (load) {
    	this._x = 175;
    	this._y = 175;
    	this.x = this._x;
    	this.y = this._y;
    	this.x_fin = this._x;
    	this.y_fin = this._y;
    	this.drag = false;
    	this.diff_x = 0;
    	this.diff_y = 0;
    }
    onClipEvent (enterFrame) {
    	if (!this.drag) {
    		this.diff_x = (this.diff_x + ((this.x_fin - this.x) / 20)) / 1.1;
    		this.diff_y = (this.diff_y + ((this.y_fin - this.y) / 20)) / 1.1;
    		this.x += diff_x;
    		this.y += diff_y;
    		this._x = this.x;
    		this._y = this.y;
    		if (this.y >= 310) {
    			this.y = 310;
    		}
    	}
    }
    onClipEvent (mouseDown) {
    	if (this.hitTest(_root._xmouse, _root._ymouse)) {
    		this.drag = true;
    		startDrag(this, true);
    	}
    }
    onClipEvent (mouseUp) {
    	this.x = this._x;
    	this.y = this._y;
    	this.drag = false;
    	stopDrag();
    }

  3. #3
    Utente di HTML.it
    Registrato dal
    Jan 2006
    Messaggi
    4
    è la prima volta che posto qui e subito ho trovato aiuto...
    Grazie di cuore

  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.