New blog, new lab

14 11 2007

The bad news is that this blog is no longer active. I will keep it up but it will no longer be updated. The good news is I have migrated to a new blog, Please update your bookmarks and links. Thanks!!


Web Service Cache

7 11 2007

I was working on my as3 web service package today and I decided to implement a class for caching service results. This feature is optional and it’s turned off as a default.

This feature can come in handy if you’re calling a method from a service with the same parameter(s) more than once. If it’s enabled, the cache object will store the results in an array for faster access later on, no need to send the same SOAP request again to the service.

I think using this feature is better than relying on the browser’s cache because what I’ve learned in the past is that the browser’s cache is in some cases turned off by the user.

This neat little feature will be part of my next release (soon i hope) of the web service package for actionscript 3. In the meantime, you can download my latest release from the link under “Downloads” on the right panel.

Caption timing for FLVs

5 11 2007

If you’ve ever tried to sync captions to an FLV then you know that it can be time consuming, and sometimes a little boring (depending on the video =P). We had to do this at work and there was no way I was going to sit there, and type out the start & end times, line by line, for every couple of words i had to show in the captions.

There was only one solution, and no, it’s not to sit there and just do it. I was feeling extra lazy, so I built a tool to make my life easier. It’s not the most elegant tool in the world, but it did get the job done. I’m hoping to improve on it, just give it a little time.

Here’s a little step by step on how to use it:

1. Click on the “Open Video” button in order to show the prompt.


2. Type in the full path to your FLV and click “Open”.

3. Create the format you want your captions in. At work we had an XML file that used a node repeatedly, which we loaded into a closed captioning component for the FLV. Use the following keywords to format your captions:
_START_TIME_ : This is where the tool will insert the start time for the caption
_END_TIME_ : This is where the tool will insert the end time for the caption.
_CAPTION_ : This is where your text will be placed for the caption.

4. Paste the text in this area for the caption you want to create.

5. Scrub or watch the video and press the buttons to select your start & end times for the caption.

6. When you’re done take a look at the “FORMAT PREVIEW” text box to see what your caption will look like with the format you specified. If you’re happy with it, just hit the “Record Caption” button.

7. As you play the video or scrub through it, you can preview your timing on the bottom left text area. The captions you have recorded will show here.

8. When you’re done setting the start & end times, you should have something you can use in order to display captions with your FLVs. The output area will have all the captions you recorded formatted the way you wanted.

You can use the FLVPlaybackCaptioning component that Brandon Flowers mentioned in his blog post to do the rest if you prefer.

Click here to download the tool!






Web Service in AS3, Release 1.0

27 10 2007

I completed what seems like a stable version of my web service class. It’s been tested on 3 different services and has been successful in calling methods in each of those 3 services. Some features in this class are:

  • Queued service calls: Methods will be executed in the order they are called in.
  • Assign callbacks: You can assign a function to execute for every service call you make when the response has loaded.
  • Automatic SOAP requests: The class will build and send the SOAP requests for you, no need to create chunks of XML manually.

Here’s come example code using a sample webservice taken from “Advanced ActionScript 3 with Design Patterns” book:


var ws:WebService = new WebService();
ws.addEventListener(Event.CONNECT, connected);

function connected(evt:Event):void{
 ws.ResolveIP(done, "", 0);

function done(serviceRespone:XML):void{
 trace("Web Service Result: ");

Being able to call web service methods easily was the first thing on my mind while building this object. As you can see above, all you need to do is call a method in the object which would have the same name as the method you are trying to call in the web service. The first parameter would be the function you want called when the response is loaded and everything else are the parameters that method is expecting.

Click here to download the package!

Web Service in AS3, part 2

26 10 2007

***UPDATE: CLICK HERE to read the latest about this subject and to download the completed web service class***

As I mentioned in yesterday’s post, I was able to grab service information from a web service including available methods and the parameters needed for each one. Today I was able to use that data and create a SOAP request at runtime. I hope to test out the request by sending it to the service and waiting to see what I get back, but that will have to wait until tomorrow.

Web Service in AS3

25 10 2007

***UPDATE: CLICK HERE to read the latest about this subject and to download the completed web service class***

I haven’t been doing much with AS3 so I thought I would do a little experiment. Considering that I’ve been reading up on ASP.NET, I thought it would be good to figure out if AS3 has done anything new with the web service component. After searching the help files and doing a couple searches, I found out that Adobe did do something new…they got rid of it.

After reading some blogs and tutorials, accessing web services takes a little bit more than I’m used to. Now you must create a SOAP request manually, which is a little too much work if you’re working on a big project that’s heavy on web services.

That being said, I’ve been working on my very own web service class which will be able to call web service methods by specifying the method name and the required parameters. SOAP requests will be created at runtime which should minimize the amount of work needed.

As of this post, I’ve been able to successfully grab the available methods in a web service, along with every method’s required parameters. I’ll be using this data to create SOAP requests at runtime whenever a service method is called.

I’ll be posting more about this class as I build it out.