[Component] Location WatchDog v1.0

It’s been a long time since I posted in my blog. The reason was that I wasn’t actually working actively on any Flex project in my previous job at Nokia. In my new role, I hope to get lots of chances to dabble with my favorite coding language 😉 . Anyway, here I am with a new simple and silly component again 🙂

I am calling it a Location WatchDog. What it does is pretty simple. It monitors a specific location (folder/directory) for any updates. If any new files are added to the folder, the WatchDog throws an event LocationEvent.FILES_ADDED. The event returns an array of new Files added to the location.

I am still working on it. Need to add some more stuff to it like capability to fire the LocationEvent.FILES_DELETED that returns the list of deleted files. The component allows you to also specify file extensions that you wish to monitor the location for. By default the component only detects normal files, while it also allows you to specify includeSystemFiles attribute as true to force the component to listen to even hidden and system files.

You can download the component in swc from here. The code of the component is checked in at the Google Code.

You can use this component in your code by calling the component in your mxml  – and then doing this in your actionscript-

private function initView():void{
snoopy.fileExtensions = <code>new Array("txt", "abc");</code>
<code>snoopy.locationPath = File.desktopDirectory.nativePath;
snoopy.addEventListener(LocationEvent.FILES_ADDED, getNewFiles);
snoopy.startPinging();
}

private function getNewFiles(event:LocationEvent):void{
var x:Object = event;
}

Nothing fancy. Just simple and plain. As long as it saves someone somewhere some coding time ;). Or is it already part of the framework? 😉

(Download: SWC | Source)

Advertisements

CForm SWC

Lately I have been getting a lot of mails about using CForm. So, I kind of wrapped up the whole thing into a SWC and here it is. So all you need to do is download this and add this to the Lib of your project. For the source code, you can still check it out of SVN. But, to just use the CForm, you really do not need the source-code, you can just use this swc component. Click here to download the component.

[Component] CForm v1.0

CForm is all about creating data entry screens. This component allows developers to create standardized forms/CRUD screens in their applications. The CForm component is a Data Entry component that can be very useful if –

  1. you are building business applications with many data entry/view screens
  2. you are working with a lot of developers. each handling separate screens/modules
  3. you wish all your screens to have the standard look & feel across the application
  4. you wish to avoid different developers/designers designing their own UI/UX paradigms for their specific screens

Let me try to explain this in a very simplified manner. CForm reads XML file to create user entry forms. To implement CForm, the following steps are involved.

  • Developer creates XML file for each screen. The XML will contain the list of fields, controls to be used etc.
  • CForm is called in an MXML.
  • Now, the developer can use many of CForm’s exposed methods to access/manipulate data in the CForm.

The Demo walks you through a few use cases of how CForm can be used in real world. There are clear instructions on each example in the demo. For a detailed documentation on the XML part of this component, check out here and for the AS and MXML angle check out below. The source code will also be made available shortly in a 2 or 3 weeks. As of now, if you need the source code you will have to check it out from the SVN repository at http://flexedtoolkit.googlecode.com/. If you like this component and would be willing to extend a helping hand, send me a mail 😉 .

If you have any questions/suggestions after viewing the demo, leave a comment on this page!!

**Update: Compiled SWC now available for download.

[ SWC | Demo | XML Documentation | Source of Example ]

Read more of this post