This content has been marked as final. Show 6 replies
What method are you trying to use? TextFormat and CSS all require that the text be added before the formatting is applied. Perhaps you are trying to add/change the text in the field after the formatting is applied which would make it appear as though the formatting isn't applying (when it reality it is being removed).
Thanks for your answer :)
I know little about Flash, but the procedure is the following:
The Flash parses an RSS file and displays it in the textfield. So the text gets loaded dynamically, pulling whatever RSS you specified.
Therefore I want to apply general styles to the textfield, so that whatever text gets pulled into it and displayed has a certain font and colour. Maybe even assign color for headers, links and paragraph.
Now, no matter how it actually works, anything I read on loading CSS into the flash, using AS to style the text field, I couldn't get anything to work.
I would be greatful if anyone had an example of a flash file which styles a text field so I could actually see how it's done in practice instead of spmnding hours reading through incomplete and cryptic documentation which only ever half addresses my issues :)
Do you need this done is AS2 or AS3? The process is different for both. More than willing to supply an example but need to know the language it has to be coded in.
Thanks very much, that's very kind of you!
It's AS3. Sorry, I just realised the link above doesn't work:
This is where it nees to go. This is AS3 and created the RSS parser inside the Flash. This is the basic version, code as follows
var widget; //Widget
//your widget has started and is ready for display
//add the textfield to the form
textfield = new TextField();
textfield.x = 5;
textfield.y = 5;
textfield.width = 280;
textfield.height = 380;
textfield.multiline = true;
textfield.wordWrap = true;
rss = widget.newRSS();
rss.load(new URLRequest(" http://feeds.feedburner.com/yourminis"));
var loader:URLLoader = URLLoader(evt.target);
var rssxml:XML = XML(loader.data);
var str = "";
for each (var item:XML in rssxml..item)
str+="<b><a href='" + item.link + "' target='_blank'><u>" +
item.title + "</u></a></b><br/>" +
item.description + "<br/><br/>";
textfield.htmlText = str;
I want all the text inside this textfield containing to be styled to my liking. I don't know enought about Flash, but with CSS I could style each element individually and/or apply global styles to the entire element.
Thanks again for your help!
Another thing I may add, no offense intended, I don't know if there are any rules about this. But while on this project, which is a quick job with a few snippets I may just contract a Flash pro to do it for me. If you are interested in this sort of "quickie" then I'd be more than happy to pay you for anything you do for me.
If I broke forum rules or offended you by proposing this then please disregard, no offence intended whatsoever and I'll just go to a project exchange site.
I just figured that I spent all day with this while I'm sure a pro could do it all in a couple of hours and I have better things to do with my time than learn AS3 for what is really just a little toy for us...
Chris, e-mail me email@example.com I'm not offended at all. I can look at the file and we can go from there.