IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Flash Discussion :

createTextField problème de format HTML


Sujet :

Flash

  1. #1
    Membre actif
    Profil pro
    Inscrit en
    Février 2004
    Messages
    582
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2004
    Messages : 582
    Points : 218
    Points
    218
    Par défaut createTextField problème de format HTML
    Bonjour,
    J'ia un problème avec la création d'un texte pour son format d'affichage.
    Mon code

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    var monFormat:TextFormat;
    monFormat= new TextFormat(); 
    	with (monFormat) { 
    		font = "Verdana";
    		size = 14; 
    		align = "left"; 
    		leading=-2;
    	}
     
    qst=this.createEmptyMovieClip("Qst",this.getNextHighestDepth());
    qst.createTextField ("Text" , qst.getNextHighestDepth(), 100, 100, 400, 50);
    with (qst.Text) { 
    	wordWrap = true;
    	type="dynamic";
    	textColor = "0x000000"   ;
    	html=true;		
    	selectable = false;
    	border = false;
    	multiline =true;
    	embedFonts=true;
     
    } 
     
    qst.Text.htmlText = "<b>Gras</b> texte";
    qst.Text.setTextFormat(monFormat);
    Il ne m'affiche que "texte"
    Si j'enlève
    Il m'affiche bien Gras texte
    Mais le texte est sans anti-alias... hors j'aimerais que si...
    J'ai essayé la propriété _quality mais cela ne change rien...
    Comment faire ?

    Merci

  2. #2
    Inactif Avatar de CR_Gio
    Profil pro
    Inscrit en
    Septembre 2005
    Messages
    1 195
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2005
    Messages : 1 195
    Points : 1 186
    Points
    1 186
    Par défaut
    Salut,

    Il y a la propriété antiAliasType de la class TextField a partir de flash8 pour cela. Mais il faut que embedFonts=true .
    Pour utiliser embedFonts=true, il faut que tu ai auparavant intégré une police.

  3. #3
    Membre actif
    Profil pro
    Inscrit en
    Février 2004
    Messages
    582
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2004
    Messages : 582
    Points : 218
    Points
    218
    Par défaut
    Si j'intègre une police dans ma bibli appelée FontVerdana...
    et que je fais
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    var monFormat:TextFormat;
    monFormat= new TextFormat(); 
    	with (monFormat) { 
    		font = "FontVerdana";
    		size = 14; 
    		align = "left"; 
    		leading=-2;
    	}
     
    qst=this.createEmptyMovieClip("Qst",this.getNextHighestDepth());
    qst.createTextField ("Text" , qst.getNextHighestDepth(), 100, 100, 400, 50);
    with (qst.Text) { 
    	wordWrap = true;
    	type="dynamic";
    	textColor = "0x000000"   ;
    	html=true;		
    	selectable = false;
    	border = false;
    	multiline =true;
    	embedFonts=true;
     
    } 
     
    qst.Text.htmlText = "<b>Gras</b> texte";
    qst.Text.setTextFormat(monFormat);
    Mon texte est bien anti-aliasé... mais Gras n'est pas en gras (Gras texte sont identiques...)

  4. #4
    Membre actif
    Profil pro
    Inscrit en
    Février 2004
    Messages
    582
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2004
    Messages : 582
    Points : 218
    Points
    218
    Par défaut
    Est ce que c'est impossible d'avoir du texte interprétant le html et antialiasé en même temps?
    Merci

  5. #5
    Inactif Avatar de CR_Gio
    Profil pro
    Inscrit en
    Septembre 2005
    Messages
    1 195
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2005
    Messages : 1 195
    Points : 1 186
    Points
    1 186
    Par défaut
    Je pense que tu a oublié d'importé la police en gras ( bold )
    Il y a une case a cocher si je me souvien bien dans la fenetre de dialogue lors de l'importation de la police.

  6. #6
    Membre actif
    Profil pro
    Inscrit en
    Février 2004
    Messages
    582
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2004
    Messages : 582
    Points : 218
    Points
    218
    Par défaut
    Mais dans ces cas là tout le texte est en gras.....

  7. #7
    Inactif Avatar de CR_Gio
    Profil pro
    Inscrit en
    Septembre 2005
    Messages
    1 195
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2005
    Messages : 1 195
    Points : 1 186
    Points
    1 186
    Par défaut
    Il faut importer chaque style de police que tu va utiliser.
    donc la normal et en gras.

  8. #8
    Membre émérite
    Avatar de jean philippe
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    2 062
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 2 062
    Points : 2 313
    Points
    2 313
    Par défaut
    salut
    dans ce cas utilise les CSS (TextField.StyleSheet = new TextField.StyleSheet ()

  9. #9
    Membre actif
    Profil pro
    Inscrit en
    Février 2004
    Messages
    582
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2004
    Messages : 582
    Points : 218
    Points
    218
    Par défaut
    Citation Envoyé par CR_Gio
    Il faut importer chaque style de police que tu va utiliser.
    donc la normal et en gras.
    Ca ne convient pas à ce que je veux, je n'ai pas un texte en gras et un en non gras... j'utilise la balise <b> pour mettre une partie seulement de mon texte en gras....

  10. #10
    Membre actif
    Profil pro
    Inscrit en
    Février 2004
    Messages
    582
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2004
    Messages : 582
    Points : 218
    Points
    218
    Par défaut
    Citation Envoyé par jean philippe
    salut
    dans ce cas utilise les CSS (TextField.StyleSheet = new TextField.StyleSheet ()
    Le problème c'est que c'est l'utilisateur qui saisit le texte... alors juste une balise <b> pour que cela soit en gras, c'est plus simple a expliquer que un CSS...

  11. #11
    Membre émérite
    Avatar de jean philippe
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    2 062
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 2 062
    Points : 2 313
    Points
    2 313
    Par défaut
    que le mec tape <b> ou h1 par exemple , c'est pas plus compliqué

  12. #12
    Membre actif
    Profil pro
    Inscrit en
    Février 2004
    Messages
    582
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2004
    Messages : 582
    Points : 218
    Points
    218
    Par défaut
    Oui, je vais voir du côté des CSS alors....en espérant que cela résoudra mon problème...

Discussions similaires

  1. Problème mail format HTML
    Par Azharis dans le forum Langage
    Réponses: 3
    Dernier message: 31/07/2012, 09h26
  2. [Mail] Problème d'envoi de mail au format HTML
    Par Romalafrite dans le forum Langage
    Réponses: 2
    Dernier message: 27/02/2007, 11h42
  3. [Mail] Problème envoi e-mail format HTML
    Par Sayrus dans le forum Langage
    Réponses: 13
    Dernier message: 19/12/2006, 14h57
  4. Problème avec le format HTML pendant le parsing
    Par hatemnafti dans le forum Format d'échange (XML, JSON...)
    Réponses: 2
    Dernier message: 28/11/2006, 10h54
  5. [Mail] Problème avec mail au format HTML
    Par kidpigeyre dans le forum Langage
    Réponses: 4
    Dernier message: 06/11/2006, 16h26

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo