+ Reply to Thread
Results 1 to 3 of 3

textFormat dinamicamente

This is a discussion on textFormat dinamicamente within the Actionscript 3.0 avanzato forums, part of the Flash Italiano category; Come faccio a settare il formato in maniera dinamica di una textArea in runtime? C Cioè vorrei aggiungere all'interno di ...

  1. #1
    Junior Member Settled In oscaroxy is on a distinguished road
    Join Date
    Jul 2008
    Posts
    13
    Rep Power
    0

    Post textFormat dinamicamente

    Come faccio a settare il formato in maniera dinamica di una textArea in runtime? C

    Cioè vorrei aggiungere all'interno di un contenitore dei componenti dinamicamente (per esempio textArea o textInput) e vorrei settare il formato (esempio bold , italic, ecc) ogni volta che lo aggiungo al contenitore.

    Tramite una funzione decido di aggiungere una textArea con una formattazione che è funzione di un parametro.

    function miaFunc(x:int):void{
    var textAreaFormat:TextFormat = new TextFormat();
    if (x == 0){
    textAreaFormat.italic = true;
    }
    var t:TextArea = new TextArea();
    t.setStyle("textFormat", textAreaFormat);
    addChild(t);
    }

    il problema è che i caratteri che immetto nella textArea in runtime (utilizzandola ovvimante come campo di input in una form) creata non ha alcuna formattazione ... why?

  2. #2
    tem
    tem is offline
    Moderator Moving My Stuff To The FlepStudio tem is on a distinguished road tem's Avatar
    Join Date
    Jan 1970
    Posts
    753
    Rep Power
    44

    Re: textFormat dinamicamente

    Ciao! io uso textField cmq puoi settarglielo in questo modo:
    Code:
    t.setTextFormat(textFormat);
    oppure
    t.defaultTextFormat=(textFormat);

  3. #3
    Junior Member Settled In oscaroxy is on a distinguished road
    Join Date
    Jul 2008
    Posts
    13
    Rep Power
    0

    Re: textFormat dinamicamente

    Quote Originally Posted by tem View Post
    Ciao! io uso textField cmq puoi settarglielo in questo modo:
    Code:
    t.setTextFormat(textFormat);
    oppure
    t.defaultTextFormat=(textFormat);
    purtroppo sto lavorando in flex e textfield non posso utilizzarlo, in aggiunta non so come ricavarlo dal componente TextInput o TextArea, dal momento che entrambi ne fanno uso!

+ Reply to Thread

Similar Threads

  1. VideoCorso n. 15 TextFormat
    By Tullio in forum Video corsi
    Replies: 2
    Last Post: 05-06-10, 21:23
  2. Cambiare lo stile di un div dinamicamente
    By erika in forum CSS | HTML
    Replies: 1
    Last Post: 22-09-09, 06:39
  3. Dati da caricare dinamicamente
    By Surya in forum Actionscript 3.0 base
    Replies: 12
    Last Post: 22-02-09, 11:18
  4. Apply a TextFormat to a TextField
    By Flep in forum Tutorials
    Replies: 0
    Last Post: 07-11-07, 05:56
  5. Applicare un TextFormat ad un campo di testo
    By Flep in forum Articoli e tutorials
    Replies: 0
    Last Post: 27-09-07, 05:31

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts