views:

172

answers:

1

I am loading css file in Flex 3 AIR application. While reading the style name, I am lowercase version of it (i.e, .NewFontStyle is converted to .newfontstyle)

how to get name as mentioned in css file.

my code:

private  var prefsCSS:StyleSheet = new StyleSheet();

private function ReadStylesCSS():void
{
    fileStream.open(appStorageDirFile,FileMode.READ);
    prefsCSS.parseCSS(fileStream.readUTFBytes(fileStream.bytesAvailable));
    fileStream.close();
}

I get my style names in prefsCSS.styleNames by looping through it.

for each (var item:String in prefsCSS.styleNames)
{                
    var stylename:String=item;
}

by this iam getting all styleNames in lower case only.. i need to get the name as mentioned in css file

Thanks in advance

A: 

There is no way to change this behavior. The class flash.text.StyleSheet is not meant for parsing Flex CSS. It is used with TextField HTML where selectors should be all lowercase.

joshtynjala
hi joshtynjala, Then there is no other way to get the styleName in the right case in Flex3 Air application.
vineth
If I were you, I would write my own CSS parser. Alternatively, you might use the recommended compiled CSS SWFs to load styles at runtime.
joshtynjala