My Projects
Search Blog

Categories
Archives
Useful Links
Photo Albums
RSS

Powered by
BlogCFM v1.15

Vivio Technologies VPS Hosting
15 August 2007
AIR Url - Adobe AIR Project

The Adobe on AIR bus tour is stopping by the Raleigh area on Saturday, courtesy of TACFUG and RDAUG, and they're having a contest.  Best AIR app wins a prize!

Well, my url shortener app may not be the best, but if I'm lucky, it'll be the only app submitted.

I've recompiled the URL shortener app as an AIR app (I built it when it was still called Apollo), and you can get it here:

Here's the source code:

 

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication
 xmlns:mx="http://www.adobe.com/2006/mxml"
 layout="absolute"
 width="400" height="68"
 creationComplete="init()">
<mx:Script>
 <![CDATA[
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.Fault;
import mx.controls.Alert;

import mx.utils.StringUtil;

private function init():void {
 txtLongUrl.setFocus();
}
private function genericFault(e:FaultEvent):void
{
 txtShortUrl.text = e.fault.faultString;
 btnTryIt.enabled = false;
}
private function tryUrl(url:String):void {
 navigateToURL(new URLRequest(url), '_blank');
}
private function addUrlResult(e:ResultEvent):void {
 txtLongUrl.text = '';
 txtShortUrl.text = e.result.toString();
 if (e.result.toString() != 'Invalid Source URL!') {
  btnTryIt.enabled = true;
 }
}
 ]]>
</mx:Script>
 <mx:WebService id="ro" wsdl="http://url.rickroot.com/url.cfc?wsdl" showBusyCursor="true">
  <mx:operation name="addUrl" fault="genericFault(event)" result="addUrlResult(event)"/>
 </mx:WebService>
 <mx:VBox x="10" y="10">
  <mx:HBox>
   <mx:Label text="Url to Shorten:" width="100" fontWeight="bold"/>
   <mx:TextInput id="txtLongUrl" width="200"/>
   <mx:Button id="btnDoIt" label="Do It!" click="txtShortUrl.text = ''; ro.addUrl(txtLongUrl.text);"/>
  </mx:HBox>
  <mx:HBox>
   <mx:Label text="Results:" width="100" fontWeight="bold"/>
   <mx:TextInput id="txtShortUrl" width="200"/>
   <mx:Button id="btnTryIt" label="Try It!" click="tryUrl(txtShortUrl.text);" enabled="false"/>
  </mx:HBox>
 </mx:VBox> 
</mx:WindowedApplication>

 

 

Posted by rickroot at 9:06 AM | Link | 1 comment
11 May 2007
My First Apollo Application

okay, it's really my second apollo application.  But it seemed silly for my first apollo blog entry here to say "My second apollo application" when I never mentioned the first one.  Plus, the first one is really an internal app for my job that serves no purpose outside my department.

Anyway, if you participate in a lot of mailing lists, then you probably use tinyurl a lot.  Need a shorten a URL, load up www.tinyurl.com, paste in your url, and submit.  It returns a nice "tiny url" for you.

Well now you can have a little flex app running all the time called "My Url Shortener" that does the same thing, without having to launch a browser.  Just keep it running.. put it in your startup or something like that. 

To run this application, you'll first need to install the Apollo Runtime from Adobe, then get the MyUrlShortener installer and run it.

If you'd like the source, which includes the mxml, cfc, and cfm files, along with a README.TXT, the LICENCE.TXT, the air file, and a sample virtual host entry from httpd.conf using mod_rewrite, you should download MyUrlShortner.zip.

Posted by rickroot at 2:37 PM | Link | 0 comments