|
This relies on your knowing something about Macromedia Central.. if you haven't heard of it, you can find info here. I was exploring how LCService connections work and also looking at the new regular expression commands back in early September and came up with this little example application. I named it FiRe.. short for "Find Replace".. As far as functionality it certainly isn't a "killer app" by any stretch of the imagination, as all it really does is Find and Replace and a few other text manipulations. However, since creating it I've found some pretty good uses for it. Anyway, the interesting thing that it shows is one way an Agent can be used in Central. Basically an Agent is a SWF that is packaged with a Central application that sends or receives data from either Central Applications or Central Pods. It can also be used to connect to external data sources such as web services. The Agent can call functions within the Apps and Pods, and likewise the Apps and Pods can make function calls to the Agent. There are security measures you can put in place to restrict which functions on the Agent the Apps and Pods can call, and you can also set the Agent up so that it can receive and send data to or from any app (even one from someone elses application). In this way you can create sort of a local server (or web service) running on the client system that your Apps can use as a centralized repository of functions and data. Agents run all the time in the background, and can be used to schedule tasks such as retrieving stock quotes every hour. The result is when an app or pod loads it can make a request to the Agent, and the Agent already has all the data ready to send back to the App or Pod. So, the FiRe app I created uses the Agent to store the settings for what text you are finding and replacing, as well as how you want it transformed (remove all tabs, remove all spaces, remove carriage returns, etc). When the user clicks the Find/Replace button in either the App or the Pod the App or Pod sends the original text string to the Agent. The Agent then processes the string and returns the result. At the same time it saves the settings (text in find and replace boxes, and transformation settings) to a Local Shared Object on the client system (an LSO is a Flash version of a cookie, only the data is stored as native Flash objects). Here's a screenshot (click it to see it full sized..) I've blocked out the icons for the other Apps I have installed.. since Central is still in Beta..
You can install it on your system by clicking the Install button below.
Once you get it installed, try a Find and Replace and change what you are finding and replacing. Open a Pod (or two) and notice that as you do a Find/Replace all of the Apps and Pods will update to the most recent settings. e-mail me if you are interested in the FLA for this app.. if there's enough interest I'll clean up my code and post it. Features List (as if it's a real application.. hehe)
some bits of code..
Changelog: 10/26/03:
|
|||||||||||||||||||||||