Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    Script per testo a comparsa

    Salve
    sapete dirmi come fare per dire a quato script di farmi comparire una determinata scritta quando sono in rollOver?

    posini = new Array();
    posini[0] = -275;
    andata = 0;
    function menuosx() {
    this.onEnterFrame = function() {
    for (i=1; i<=6; i++) {
    posini[i] = posini[i-1]+this["b"+i]._width/2;
    this["b"+i]._x = posini[i];
    this["b"+i].onRollOver = function() {
    scala(this, 140);
    andata = 1;
    };
    this["b"+i].onRollOut = function() {
    scala(this, 100);
    andata = 0;
    };
    posini[i] = posini[i-1]+this["b"+i]._width+15;
    }
    };
    }
    menuosx();
    function scala(clip, val) {
    tempo = 0;
    clip.onEnterFrame = function() {
    clip._width -= (clip._width-val)/4;
    clip._height -= (clip._height-val)/4;
    };
    }

    sono 5 pulsanti e vorrei che ogni volta che sono su di loro mi comparisse una scritta diversa

    Grazie

  2. #2
    a prima vista ti rimangono enterFrame accesi ogni volta che chiami la funzione scale

    controlla il termine della scalatura e delete l'enterFrame.

    perchè non lo rifai con le Tween ??

    codice:
    Stage.scaleMode="noScale"
    import mx.transitions.*;
    import mx.transitions.easing.*;
    
    testi_array = new Array()
    testi_array[0]="testo 0"
    testi_array[1]="testo 1"
    testi_array[2]="testo 2"
    testi_array[3]="testo 3"
    testi_array[4]="testo 4"
    testi_array[5]="testo 5"
    testi_array[6]="testo 6"
    testi_array[7]="testo 7"
    testi_array[8]="testo 8"
    testi_array[9]="testo 9"
    testi_array[10]="testo 10"
    
    
    MovieClip.prototype.effetto=function(){
    
      this.onRollOver = function() {
          var twX = new mx.transitions.Tween(this, "_xscale", None.easeNone, 100, 140, 1, true);
          var twY = new mx.transitions.Tween(this, "_yscale", None.easeNone, 100, 140, 1, true);
          scritta()
       };
    	
       this.onRollOut = function() {
          var twX = new mx.transitions.Tween(this, "_xscale", None.easeNone, 140, 100, 1, true);
          var twY = new mx.transitions.Tween(this, "_yscale", None.easeNone, 140, 100, 1, true);
        };	
    }
    for(I=1;I<6;I++){
       this["BTN"+I].effetto()
    }
    
    function scritta(){
        campo.text = Testi_array[random(10)+1]
    }

  3. #3
    ops scusa solo adesso ho visto "su di loro"

    quindi sostituisci con

    codice:
    this.onRollOver = function() {
          var twX = new mx.transitions.Tween(this, "_xscale", None.easeNone, 100, 140, 1, true);
          var twY = new mx.transitions.Tween(this, "_yscale", None.easeNone, 100, 140, 1, true);
          this.campo.text = testi_array[random(10)+1]
       };
    buttando la funzione scritta()

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.