Oui merci
j'y était arrivé en fait lol ^^ par contre s'est bizarre qu'on soit obligé de mettre les deux paramètre width et height a l'image pour la redimensionner et pas seulement le width enfin bref pas grave.
Sinon j'ai un petit soucis , je sais pas si sa te le fait aussi mais une fois l'image ajoutée , quand je tape du texte a la suite la taille des caractères se met a 2 , j'avais ce problème avec mon script et je le retrouve avec le tiens aussi.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
width="800" height="604" >
<mx:Script>
<![CDATA[
private function addImg():void
{
rte.textArea.htmlText += "<img src='Tree.jpg' width='150' height='150' />"
}
]]>
</mx:Script>
<mx:RichTextEditor id="rte" width="800" height="600" />
<mx:Button x="285" y="330" label="Display" click="addImg()" />
</mx:Application> |
Il y a aussi un problème au niveau de la scrollbar, j'ai l'impression qu'elle ne prend pas très bien en compte les images , par exemple si je fait scroller a l'aide du texte et que je rajoute des images , je peut descendre avec la scrollbar jusqu'au bas du texte mais je peut encore descendre au dela de la scrollbar pour voir les images plus bas.. lol !
Je n'arrive pas non plus a center une image :o
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 26 27 28
| <?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
width="800" height="604" >
<mx:Script>
<![CDATA[
private function addImg():void
{
rte.textArea.htmlText += "<img src='Tree.jpg' width='150' height='150' align='right'/>"
}
private function addImg2():void
{
rte.textArea.htmlText += "<center><img src='Tree.jpg' width='150' height='150'/></center>"
}
private function addImg3():void
{
rte.textArea.htmlText += "<center><img src='Tree.jpg' width='150' height='150'align='middle'/></center>"
}
]]>
</mx:Script>
<mx:RichTextEditor id="rte" width="800" height="600" />
<mx:Button x="285" y="330" label="Displayright" click="addImg()" />
<mx:Button x="285" y="360" label="Displaycenter" click="addImg2()" />
<mx:Button x="285" y="390" label="Displaymiddle" click="addImg3()" />
</mx:Application> |
L'image s'affiche soit a gauche, soit a droite .. jamais au centre 
Merci d'avance
EDIT : Je viens de regarder et j'ai trouver pourquoi sa bug au niveau du centre et de la police :
Quand on ajoute l'image, le RichTextEditor n'ajoute pas seulement le htmlText avec la balise mais tout sa :
<P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="2" COLOR="#0B333C" LETTERSPACING="0" KERNING="0"><img src='Tree.jpg' width='150' height='150' /> </FONT></P>
Seulement voilà , je ne sais pas comment y remédier lol...
Partager