PDA

View Full Version : External CSS issue



Ness_du_Frat
March 19th, 2010, 04:40 PM
Hi!
I'm trying to have an external css file added to a textfield, but I can't get it to work...

Here is what I've done :


var styleromans:StyleSheet;
var chargeur:URLLoader= new URLLoader();
var adresseCSS:URLRequest= new URLRequest("lien.css");
chargeur.load(adresseCSS);
chargeur.addEventListener(Event.COMPLETE, cssChargees);
function cssChargees(evt:Event) {
styleromans= new StyleSheet();
styleromans.parseCSS(evt.target.data);
contenu.content_txt.styleSheet= styleromans;
}


var fichierXML:XML;
var chargeurDonnees:URLLoader=new URLLoader();
var adresseFichierXml:URLRequest=new URLRequest("http://zarkan.org/test/liensauteur.php");
function donneesOk(event:Event) {
fichierXML=new XML(chargeurDonnees.data);
contenu.title_txt.text= "Romans en ligne";
var listeromans:XMLList=new XMLList(fichierXML.romansenligne);

contenu.content_txt.htmlText+="<ul>"
for each (var romans in listeromans) {

contenu.content_txt.htmlText+="<li class=\"site\"><a href=\""+romans.urllien+"\" target=\"_blank\">"+romans.@nom+"</a></li><li class=\"desc\">"+romans.descr+"</li>\n";
}
contenu.content_txt.htmlText+="</ul>"
}

and my css looks like that :


.li {
list-style-image:url(http://www.lesenfantsdelo.com/book/licoche.gif);
padding-right:10px;
}

#content li {
color: #333333;
font-size:10px;
font-family:Arial, Helvetica, sans-serif;
line-height: 17px;
text-align: justify;
background-image: url(http://www.lesenfantsdelo.com/book/ligne.gif);
margin-left: 0px;
margin-right: 0px;
}
.desc {
list-style-image:url(http://www.lesenfantsdelo.com/book/libook.gif);
padding-bottom:15px;
margin-bottom:15px;
border-bottom:1px solid #990000;

}
.site {
list-style-image:url(http://www.lesenfantsdelo.com/book/liaro.gif);
color:#990000;
}
.site a {
color:#990000;
text-decoration:none;
}
.site a:hover {
text-decoration:underline;
}
.site a:visited {
color:#666666;
}
li.site strong {
color:#000000;
font-weight:bold;
}

The php file is actually an XML generated from a database, no problem with the output of the xml.