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

    [mx] come aumentare con AS la dimensione del carattere?

    devo aumentare la dimensione di un font in modo dinamico, ad esempio se c'è poco testo deve essere grande se invece c'è molto testo deve essere più piccolo...

    Qualcuno mi sa dire come posso fare?

    io ho provato così ma nn funziona..

    if (testo.length<=100) {
    _root.cont.testodin.size = 10;
    } else if ((testo.length>100) && (testo.length<=300)) {
    _root.cont.testodin.size = 50;
    } else if (testo.length>300) {
    _root.cont.testodin.size = 90;
    }

    HELP!
    "E d'un tratto capii che il pensare e' per gli stupidi, mentre i cervelluti si affidano all'ispirazione".
    Malcolm McDowell (Alex) in Arancia meccanica

  2. #2
    stile=new TextFormat()
    stile.size=20;
    _root.cont.testodin.setTextFormat(stile);

  3. #3
    ho provato così ma ancora nn ne vuol spaere di funzionare...


    stile = new TextFormat();
    if (testo.length<=100) {
    stile.size = 10;
    _root.cont.testodin.setTextFormat(stile);
    } else if ((testo.length>100) && (testo.length<=300)) {
    stile.size = 50;
    _root.cont.testodin.setTextFormat(stile);
    } else if (testo.length>300) {
    stile.size = 90;
    _root.cont.testodin.setTextFormat(stile);
    }

    help..I need somebody...help!!!

    "E d'un tratto capii che il pensare e' per gli stupidi, mentre i cervelluti si affidano all'ispirazione".
    Malcolm McDowell (Alex) in Arancia meccanica

  4. #4
    prova con setNewTextFormat()

  5. #5
    stile = stile.setNewTextFormat();
    if (testo.length<=100) {
    stile.size = 10;
    _root.cont.testodin.setTextFormat(stile);
    } else if ((testo.length>100) && (testo.length<=300)) {
    stile.size = 50;
    _root.cont.testodin.setTextFormat(stile);
    } else if (testo.length>300) {
    stile.size = 90;
    _root.cont.testodin.setTextFormat(stile);
    }


    anche così nn funziona...
    "E d'un tratto capii che il pensare e' per gli stupidi, mentre i cervelluti si affidano all'ispirazione".
    Malcolm McDowell (Alex) in Arancia meccanica

  6. #6
    Il codice giusto è questo, l'ho appena provato e funziona, se a te non va accertati che le condizioni siano vere, magari metti qualche trace
    codice:
    stile = new TextFormat(); 
    if (testo.length<=100) { 
    stile.size = 10; 
    _root.cont.testodin.setTextFormat(stile); 
    } else if ((testo.length>100) && (testo.length<=300)) { 
    stile.size = 50; 
    _root.cont.testodin.setTextFormat(stile); 
    } else if (testo.length>300) { 
    stile.size = 90; 
    _root.cont.testodin.setTextFormat(stile); 
    }

  7. #7
    grazie mille ora funziona perfettamente!

    "E d'un tratto capii che il pensare e' per gli stupidi, mentre i cervelluti si affidano all'ispirazione".
    Malcolm McDowell (Alex) in Arancia meccanica

  8. #8

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 © 2024 vBulletin Solutions, Inc. All rights reserved.