Skip to main content
Known Participant
July 28, 2009
Question

stylemanager for rss xml?

  • July 28, 2009
  • 1 reply
  • 733 views

import fl.managers.StyleManager;

var logFormat:TextFormat = new TextFormat();

logFormat.font = "Minion Pro";

logFormat.size = 14;

logFormat.bold = false;

logFormat.color = 0x403e3a;

I am currently using this as an alternative atm, to style the rss loaded. but now everthing is displayed with this settings.

its ok for the moment, but i really prefer to style my own way

is there a way to seperately to style, the pubDate, description, title, link etc individually?

This topic has been closed for replies.

1 reply

funkysoul
Inspiring
July 28, 2009

assuming you have an xml with a bunch of items.

var format1:TextFormat = new TextFormat();

format1.font = "Minion Pro";

format1.size = 18;

format1.bold = false;

format1.color = 0xcccccc;

var format2:TextFormat = new TextFormat();

format2.font = "Minion Pro";

format2.size = 14;

format2.bold = false;

format2.color = 0x403e3a;

for each(var item:XML in myRssXML.content.item)

{

     var title:TextField = new TextField();

     title.defaultformat = format1;

     ......

     var pubdate:TextField = new textField();

     pubDate.defaultFormat = format;

     .....

}

and so on, when you defined all your textfield and assign the styles you just need to layout the single elements.

with an if for example

if (i > 0)

{

title.x = i * 20;

...

}

ccEikouAuthor
Known Participant
July 29, 2009

Thanks, I think this script is gonna work.

But atm I am getting error, where the defaulFormat is unindentified property.

so where the defaultFormat gonna stand for?

ccEikouAuthor
Known Participant
July 29, 2009

anyone know how to setup the defaultFormat?

dunno what to put in.. : /