Re: [Flashcoders] floating wordpress blog within a swf?
Hi, I dug out some old AS2 code - which used XFactorStudio's XPath library to grab the first entry from the RSS feed and stick it in a text field. Below is the example (it uses a generic string replacement function that I think came from Mike Chambers or someone @ adobe who did some nice String library for AS2). AS3 will be similar, but you can use e4X... Again, the blog content was simple text - they stayed away from fancy formatting too much, although I have tried basic css formatting of tags, which sometimes works... There are probably better examples out there, but hopefully you can get the picture. function _xmlLoad(success:Boolean ) { if(success) { var obj:Object = XPath.selectNodes(_xmlObj, "//item[1]/content:encoded/text()"); //trace("Obj is " + obj); var content:String = replace(String(obj), "&", "&"); content = replace(content, ">", ">"); content = replace(content, "<","<"); content = replace(content, """, "\""); content = replace(content, "'", "'"); //trace(content); var format:TextFormat = mpadText.getTextFormat(); mpadText.html = true; mpadText.htmlText = content; mpadText.setTextFormat(format); } else { trace("Could not load XML"); } } Glen ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] floating wordpress blog within a swf?
Hi, You can't "easily" display the HTML from the blog inside Flash, but you can do a couple of things: Load the RSS feed of the blog into your Flash as XML and display it in a text field. You can display "simple" text content from the blog, but any fancy formatting and other stuff may be lost. However, once you have the RSS you can "parse" the content XML and extract any media links etc. and show them as you wish. Another way to do it is to use one of the API's that people have created to join Wordpress up-to Flash. There is an AMFPHP based one - http://code.google.com/p/awi/ - which lets you load posts and post meta data from the database as serialized data. Not sure how well this works, but if you were to use that, you can have more fine grained control over displaying your content, etc. I have a simple example of loading the latest article from an RSS feed and displaying it in a text field for AS2, I will post this later when I am at home if you like. Have google too - http://www.gotoandlearnforum.com/viewtopic.php?f=35&t=12121&start=0 etc... Glen thomas horner wrote: Is it possible to have a wordpress blog floating within a swf? or something as to that effect, it would be nice to keep the viewer at the site rather then redirecting them to a new window, is this possible? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders