Visualizzazione dei risultati da 1 a 5 su 5

Discussione: Sintassi corretta

  1. #1

    Sintassi corretta

    Come faccio x scrivere correttamente questa stringa??

    Codice PHP:
        testo nome_btn[count];
        
    _root.menu."Vertex"count.testo.htmlText testo
    Mi spiego count è una var usata in un ciclo while x fare dei duplicateMovieClip() vorrei assegnare al campo di testo dinamico contenuto nella clip un valore diverso x ogni clip duplicata, il valore da assegnarli è contenuto nella var testo che a sua volta lo ricava da un array, come faccio x scrivere correttamente questa cosa??

    _root.menu.Vertex1.testo.htmlText = testo ;
    _root.menu.Vertex2.testo.htmlText = testo ;

    etc etc
    Stega
    :-)

  2. #2

    x ora ho risolto

    così:

    Codice PHP:

    //
    _root.menu.Vertex1.testo.htmlText nome_btn[1] ;
    _root.menu.Vertex2.testo.htmlText nome_btn[2] ;
    _root.menu.Vertex3.testo.htmlText nome_btn[3] ;
    _root.menu.Vertex4.testo.htmlText nome_btn[4] ;
    _root.menu.Vertex5.testo.htmlText nome_btn[5] ;
    _root.menu.Vertex6.testo.htmlText nome_btn[6] ;
    _root.menu.Vertex7.testo.htmlText nome_btn[7] ;
    _root.menu.Vertex8.testo.htmlText nome_btn[8] ;
    _root.menu.Vertex9.testo.htmlText nome_btn[9] ;
    // 
    ma non è la soluzione, vorrei scriverla in maniera corretta..

    Avevo pensato di creare una var temporanea con il valore giusto della clip target ma non va

    Codice PHP:

        clip 
    "Vertex" count ;
        
    testo nome_btn[count];
        
    _root.menu.clip.testo.htmlText testo
    Molto probabilmente pensa esista un mc di nome "clip"..

    Stega
    :-)

  3. #3

    Re: Sintassi corretta

    testo = nome_btn[count];
    _root.menu["Vertex" + count].testo.htmlText = testo;

    ciaooo
    "La consapevolezza di Case suddivisa come perle di mercurio. La sua visione era sferica, come se una singola retina rivestisse la superficie interna di un globo che conteneva tutte le cose, se tutte le cose si potevano contare." —Neuromante, William Gibson (1984)

  4. #4
    Utente bannato
    Registrato dal
    Mar 2002
    Messaggi
    1,322
    hai provato così


    _root.menu.Vertex[nomevariabile].testo.htmlText = nome_btn[nomevariabile]

  5. #5

    perfetto

    gracias...

    :adhone:
    Stega
    :-)

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.