PDA

View Full Version : Processing CSS inside XML



zoddo
August 5th, 2004, 02:02 PM
Hi all,
i have a tricky question: how to process css inside a xml file, which is use for display in FlashMX pro? I've done the kirupa's tutorial on XML, and find other infos on the w3schools site on how to implant css in xml, which when not in flash display the right font/color.

ok here what i am doing: first, i did a very simple css file which look like this:
NAME
{
font-family: "Trebuchet MS";
font-size: 10px;
color: #CC6600;
}

then the xml file:
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://jdl.ip-max.net/ipmax/css/menufr.css"?>

<menu.fr>
<menu.principal>
<NAME>services</NAME>
</menu.principal>
<menu.principal>
<NAME>clients</NAME>
</menu.principal>
<menu.principal>
<NAME>contacts</NAME>
</menu.principal>
</menu.fr>

note that if i display my xml file in IE, the xml display 'services', 'clients' and 'contact' on one row, but everythings fine with color etc.

in flash, i based my code on kirupa's tutorial on XML (firstchild and nodes).

so here i am, with no idea on what to do to make that work.
hope you can help :book:

p.s.: you can find the fla here (http://jdl.ip-max.net/ipmax/test.fla)

zoddo
August 5th, 2004, 10:49 PM
sweeeet! :pleased:
i finally found the sources for applying css to xml files in flash in that tutorial (http://www.actionscript.org/tutorials/beginner/XML-Formatted_Content/index.shtml)

have a nice day!

- zoddo

ahmed
August 5th, 2004, 11:29 PM
care to share it? :P

zoddo
August 6th, 2004, 12:36 AM
my bad: here's the link

http://www.actionscript.org/tutorials/beginner/XML-Formatted_Content/index.shtml

zoddo
August 6th, 2004, 01:50 PM
i suppose it is due to textArea component, but the SWF is huge for the kind of data it contains (only text): 40k for the SWF...

flashJunkie
March 2nd, 2005, 04:22 AM
Hi
You all seems to have a "grip" on FMX04 and CSS, so I ask you to please have a look at my CSS-problem below.

Short version:
I get the textfile to load put not the CSSfile. But it all works fine as stand alone .fla but when I put it in a movieclip within another .fla i don't work and gets "undefined". (I use Actionscript 2 & Flashplayer 7 in my Flash Publish settings.)

Full version:
Please have a look at my problem on another thread at this forum, found here. (http://www.kirupa.com/forum/showthread.php?t=87517)
Thank's