Archive for the ‘sugarcookie’ Category

Creating a custom logging target

Tuesday, March 3rd, 2009

I figured since I’m on the subject I would go ahead and create a custom logging target for sugarcookie and a companion logging app – LumberJack. This particular target sends log message objects over a LocalConnection to a basic logging console that will output them into a text field. Being able to see trace statements from a site running on any server, on any network can really help when debugging your application that is deployed somewhere besides your localhost. There are other tools out there that do this like RED|Bug, Xray or even FlashTracer, but this one is extremely simple and includes all the code so you can modify it to suit your needs.

First let’s create the new log target class by extending the existing mx.logging.targets.LineFormattedTarget Flex class. Then override the logEvent method with the functionality desired and you’re in business. Here’s how I did it:
(more…)

Sharing your content with Social web sites

Wednesday, October 22nd, 2008

Sharing links to your content and some additional basic information about it is pretty easy. Most social web sites offer a straight forward way to do this through url params to a basic service. sugarcookie makes this even easier by providing functionality that takes care of the finer details for the following sites:
- Facebook
- StumbleUpon
- Digg
- Reddit
- DelIcioUs
- Twitter
- MySpace

Example usage for Facebook:

TextLink.Facebook("http://www.pmko.net","Professional Monkey Keyboard Operator");

see the full source code behind the TextLink class.

Some sites, like Facebook, will scrape the HTML from the link and utilize the page title, meta description and certain images.

Sharing content with Facebook

Sharing content with Facebook