Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > Flash/Flex > Flex
Flex Forum d'entraide sur la programmation Adobe Flex : applications Internet riches (RIA)
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 27/05/2011, 10h27   #1
Candidat au titre de Membre du Club
 
Homme Vincent
Étudiant
Inscription : mai 2011
Messages : 39
Détails du profil
Informations personnelles :
Nom : Homme Vincent
Localisation : France, Yvelines (Île de France)

Informations professionnelles :
Activité : Étudiant
Secteur : Industrie

Informations forums :
Inscription : mai 2011
Messages : 39
Points : 14
Points : 14
Par défaut Textfield semi-transparent sur une bitmap

Bonjour à tous,

J'ai un petit problème avec des images (BitmapData) , je souhaiterais leur ajouter un textfield semi-transparent de couleur avec texte blanc.

J'ai réussi à effectuer le textfield noir avec le texte de couleur blanche mais le background de ce textefield reste opaque et ce malgrès tous mes essais.

(Je précise que je code en AS3).

Ce que j'aimerais en faite c'est faire une sorte de bandeau semi-opaque en haut des images pour y afficher un texte.

Si quelqu'un à une idée , je suis preneur.

Merci à tous.
vincent7894 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 27/05/2011, 10h35   #2
Membre habitué
 
Avatar de greatalain
 
Homme Alain Great
Développeur informatique
Inscription : novembre 2007
Messages : 124
Détails du profil
Informations personnelles :
Nom : Homme Alain Great
Localisation : France

Informations professionnelles :
Activité : Développeur informatique
Secteur : Communication - Médias

Informations forums :
Inscription : novembre 2007
Messages : 124
Points : 146
Points : 146
Tu as bien essayé de jouer sur le style backgroundAlpha?
greatalain est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 27/05/2011, 10h38   #3
Candidat au titre de Membre du Club
 
Homme Vincent
Étudiant
Inscription : mai 2011
Messages : 39
Détails du profil
Informations personnelles :
Nom : Homme Vincent
Localisation : France, Yvelines (Île de France)

Informations professionnelles :
Activité : Étudiant
Secteur : Industrie

Informations forums :
Inscription : mai 2011
Messages : 39
Points : 14
Points : 14
Merci d'avoir répondu.

Il ne reconnait pas le backgroundAlpha.

Voilà mon code :

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
var textfield:TextField=new TextField();
			textfield.text="ca marche";
			textfield.setTextFormat(new TextFormat(null,15,0xFFFFFF));
			textfield.background=true;
			textfield.backgroundColor = 0x000000;
			textfield.width=320;
			textfield.height=25;
			textfield.blendMode="layer";
			textfield.alpha=0.2;
			textfield.cacheAsBitmap=true;
 
 
			//bmdVideo est le bitmapData
			bmdVideo.draw(textfield);
vincent7894 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 27/05/2011, 11h02   #4
Membre habitué
 
Avatar de greatalain
 
Homme Alain Great
Développeur informatique
Inscription : novembre 2007
Messages : 124
Détails du profil
Informations personnelles :
Nom : Homme Alain Great
Localisation : France

Informations professionnelles :
Activité : Développeur informatique
Secteur : Communication - Médias

Informations forums :
Inscription : novembre 2007
Messages : 124
Points : 146
Points : 146
Crée un sprite, et c'est à ce sprite que tu ajoute le textField, je pense que cela pourrait solutionner ton problème
greatalain est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 27/05/2011, 11h20   #5
Candidat au titre de Membre du Club
 
Homme Vincent
Étudiant
Inscription : mai 2011
Messages : 39
Détails du profil
Informations personnelles :
Nom : Homme Vincent
Localisation : France, Yvelines (Île de France)

Informations professionnelles :
Activité : Étudiant
Secteur : Industrie

Informations forums :
Inscription : mai 2011
Messages : 39
Points : 14
Points : 14
Ca met un bandeau noir mais il n'est toujours pas transparent.

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var url:String=root.loaderInfo.parameters.url;
			var offre:String=root.loaderInfo.parameters.offre;
			var parrain:String=root.loaderInfo.parameters.parrain;
 
			var sprite:Sprite=new Sprite();
			var textfield:TextField=new TextField();
 
			textfield.text=url+"/"+offre+"/"+parrain;
			textfield.setTextFormat(new TextFormat(null,15,0xFFFFFF));
			textfield.background=true;
			textfield.backgroundColor = 0x000000;
			textfield.width=320;
			textfield.height=25;
			textfield.blendMode="layer";
			textfield.alpha=0.2;
			textfield.cacheAsBitmap=true;
 
			sprite.addChild(textfield);
vincent7894 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 27/05/2011, 11h37   #6
Membre habitué
 
Avatar de greatalain
 
Homme Alain Great
Développeur informatique
Inscription : novembre 2007
Messages : 124
Détails du profil
Informations personnelles :
Nom : Homme Alain Great
Localisation : France

Informations professionnelles :
Activité : Développeur informatique
Secteur : Communication - Médias

Informations forums :
Inscription : novembre 2007
Messages : 124
Points : 146
Points : 146
Et au niveau du BlendMode, il y a pas un truc à creuser, il y a un paquet de constante dont une est "ALPHA"

http://help.adobe.com/en_US/FlashPla...ect.html#alpha
greatalain est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 27/05/2011, 11h59   #7
Candidat au titre de Membre du Club
 
Homme Vincent
Étudiant
Inscription : mai 2011
Messages : 39
Détails du profil
Informations personnelles :
Nom : Homme Vincent
Localisation : France, Yvelines (Île de France)

Informations professionnelles :
Activité : Étudiant
Secteur : Industrie

Informations forums :
Inscription : mai 2011
Messages : 39
Points : 14
Points : 14
Alors j'ai essayé la méthode blendMode pour le textfield et pour le sprite et aucun résultat mis à part que ça me supprime mes variables passés par l'objet swfObject de mon javascript
vincent7894 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 27/05/2011, 12h07   #8
Membre habitué
 
Avatar de greatalain
 
Homme Alain Great
Développeur informatique
Inscription : novembre 2007
Messages : 124
Détails du profil
Informations personnelles :
Nom : Homme Alain Great
Localisation : France

Informations professionnelles :
Activité : Développeur informatique
Secteur : Communication - Médias

Informations forums :
Inscription : novembre 2007
Messages : 124
Points : 146
Points : 146
je viens de tester avec un textArea, et la j'ai bien un background transparent

Code :
1
2
3
4
5
6
7
8
9
	var t:TextArea = new TextArea()
				t.text =" toto"
 
				t.setStyle('backgroundColor', 0x000000);
				t.setStyle('backgroundAlpha', 0.2);
				t.setStyle('borderStyle','none');
				t.selectable = false;
				t.width = 100;
				t.height = 30;
greatalain est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 27/05/2011, 12h27   #9
Candidat au titre de Membre du Club
 
Homme Vincent
Étudiant
Inscription : mai 2011
Messages : 39
Détails du profil
Informations personnelles :
Nom : Homme Vincent
Localisation : France, Yvelines (Île de France)

Informations professionnelles :
Activité : Étudiant
Secteur : Industrie

Informations forums :
Inscription : mai 2011
Messages : 39
Points : 14
Points : 14
Merci mais moi il ne reconnait pas les setStyle, width et height.
Il faut savoir que je fais un programme actionscript et je n'ai pas de mxml.

J'ai donc importer le composant spark.components.TextArea donc il reconnait le textArea mais pas les méthodes.

Merci
vincent7894 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 19h58.


 
 
 
 
Partenaires

Hébergement Web