Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > Flash/Flex > Flash
Flash Forum d'entraide sur la technologie Flash (Cours, FAQs, Sources)
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 05/06/2007, 17h40   #1
Membre chevronné
 
Avatar de luta
 
Inscription : novembre 2003
Messages : 1 038
Détails du profil
Informations forums :
Inscription : novembre 2003
Messages : 1 038
Points : 691
Points : 691
Envoyer un message via MSN à luta
Par défaut [fl8] createTextField et font intégrée

Bonjour, je crée un textField en AS et lui affecte la propriété font avec la valeur myfont* qui est une police intégrée a la bibliotheque...
cela ne fonctionne pas.
Le résultat est le meme en utilisant un textFormat.
sur un text dessiné directement sur la scene, je peux sélectioner la police partagée myfont* et tout va bien...
quelqu un aurait il une idee de la chose?
Merci
luta est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/06/2007, 17h42   #2
Membre Expert
 
Avatar de jean philippe
 
Inscription : septembre 2006
Messages : 2 062
Détails du profil
Informations forums :
Inscription : septembre 2006
Messages : 2 062
Points : 2 075
Points : 2 075
Envoyer un message via MSN à jean philippe Envoyer un message via Skype™ à jean philippe
salut
Utilises tu embedFonts dans le code?
Code :
1
2
3
4
5
6
7
8
9
var my_fmt:TextFormat = new TextFormat();
my_fmt.font = "my font";
 
this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 160, 120);
my_txt.wordWrap = true;
my_txt.embedFonts = true;
my_txt.text = "Hello world";
my_txt.setTextFormat(my_fmt);
my_txt._rotation = 45;
__________________
mon Blog
jean philippe est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/06/2007, 17h55   #3
Membre chevronné
 
Avatar de luta
 
Inscription : novembre 2003
Messages : 1 038
Détails du profil
Informations forums :
Inscription : novembre 2003
Messages : 1 038
Points : 691
Points : 691
Envoyer un message via MSN à luta
non mais en l essayant j obtient un textField vide.
Quant au wordWrap (sans embedFonts), j obtient un joli text style morse en vertical.
Voici un exemple de mon code:

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
	var myformat:TextFormat = new TextFormat();
	myformat.font = "ilo*";
	myformat.size=18;
 
 
	var txt:TextField=this.createTextField("txt", 2, 0, 0, 5, 5);
 
	txt.setTextFormat(myformat);
	txt.type= "dynamic";
	txt.multiline = true;
	txt.autoSize = true;
	txt.embedFonts = true;
	txt.text=vMessage;
ce text se redimensionne automatiquement (je m'en sert pour faire une bulle d aide en fait).
Merci


ps: est ce que le "*" dans le nom de la police a une importance ou pas?
luta est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/06/2007, 18h07   #4
Membre Expert
 
Avatar de jean philippe
 
Inscription : septembre 2006
Messages : 2 062
Détails du profil
Informations forums :
Inscription : septembre 2006
Messages : 2 062
Points : 2 075
Points : 2 075
Envoyer un message via MSN à jean philippe Envoyer un message via Skype™ à jean philippe
et comme ça
Code :
1
2
3
4
5
6
7
8
9
10
var my_fmt:TextFormat = new TextFormat();
my_fmt.font = "ilo";
this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 160, 120);
my_txt.wordWrap = true;
my_txt.embedFonts = true;
my_txt.text = "Hello world";
my_txt.setTextFormat(my_fmt);
my_txt.type = "dynamic";
my_txt.multiline = true;
my_txt.autoSize = true;
__________________
mon Blog
jean philippe est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/06/2007, 18h29   #5
Membre chevronné
 
Avatar de luta
 
Inscription : novembre 2003
Messages : 1 038
Détails du profil
Informations forums :
Inscription : novembre 2003
Messages : 1 038
Points : 691
Points : 691
Envoyer un message via MSN à luta
Ca ne fonctionne que si je retire embedFonts et je n ai toujours pas ma font...
je craque
luta est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/06/2007, 19h12   #6
Membre Expert
 
Avatar de jean philippe
 
Inscription : septembre 2006
Messages : 2 062
Détails du profil
Informations forums :
Inscription : septembre 2006
Messages : 2 062
Points : 2 075
Points : 2 075
Envoyer un message via MSN à jean philippe Envoyer un message via Skype™ à jean philippe
voici un .fla
__________________
mon Blog
jean philippe est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 06/06/2007, 10h01   #7
Membre chevronné
 
Avatar de luta
 
Inscription : novembre 2003
Messages : 1 038
Détails du profil
Informations forums :
Inscription : novembre 2003
Messages : 1 038
Points : 691
Points : 691
Envoyer un message via MSN à luta
Salut jeanPhi,
j ai changé dans ton code la polie par la mienne et ça marche nickel...
je fais un copier/coller de ton code dans le mien...même résultat qu hier, ca me fait un champ vide...
luta est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 06/06/2007, 10h07   #8
Membre chevronné
 
Avatar de luta
 
Inscription : novembre 2003
Messages : 1 038
Détails du profil
Informations forums :
Inscription : novembre 2003
Messages : 1 038
Points : 691
Points : 691
Envoyer un message via MSN à luta
raaaah j avais oublié de faire la liaison AS...
Merci a toi JeanPhi
luta est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 18/07/2007, 09h14   #9
Nouveau Membre du Club
 
Avatar de bractar
 
Inscription : janvier 2004
Messages : 201
Détails du profil
Informations forums :
Inscription : janvier 2004
Messages : 201
Points : 29
Points : 29
Bonjour, j'ai à peu près le même problème,

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var container:MovieClip = this.createEmptyMovieClip("container", this.getNextHighestDepth());
var myLabel:TextField = container.createTextField("myLabel", 1, 0, 0, 150, 20);
myLabel._alpha = 0;
myLabel.type = "dynamic";
myLabel.selectable = false;
myLabel.autoSize = true;
myLabel.multiline = false;
myLabel.wordWrap = false;
myLabel.embedFonts = true;
 
var my_fmt:TextFormat = new TextFormat();
my_fmt.font = "ma_police";
my_fmt.bold = false;
my_fmt.color = 0x000000;
 
myLabel.text = "Mon Test";
myLabel.setTextFormat(my_fmt);
Dans la liaison, j'ai coché "importer pour le partage à l'exécution"
Merci d'avance pour votre aide.

ps: je ne peux pas télécharger le zip de l'exemple
__________________
Bractar the French fry eater
http://www.flale.com
bractar est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 19h51.


 
 
 
 
Partenaires

Hébergement Web