Archive for the 'AS3' Category

Sunday, 03 October 2010Posted by Whyves

I have been very quiet for the last few weeks. So, I decided to break radio silence and let you in on what I’m actually working on. I’m currently working on creating my own Captivate Widget API that will be called CpGears. As you read this, I’m sure that one question will come to mind: “Why are you doing this? Tristan already created his very good WidgetFactory API”  Well, that’s true; Tristan did an amazing job with his API but I want to do mine for specific reasons:

  • Personal challenge and accomplishment
  • Tristan wants his API to be accessible to developers of every caliber while I want mine targetted to more advanced users.
  • Having more than one option is always a good thing. Just take  a look at all the similar AS3 libraries out there.

I’m almost done with the Static widget and I will soon start working on the other two types: Interactive and Question. Some of the things that I’m adding with my API are:

  • A logger interface so you can log and trace messages from your widgets.
  • A different way for handling the widget flow/lifecycle.
  • A more object oriented approach to accessing the widget data. I don’t like the CpMovieHandle, CpSlideHandle, CpSlideProperties and other native widget classes. So, I offer a more structured interface for accessing that data.

The API will be developed under a MIT Open Source License and be hosted on Google Code. In order to make sure that I don’t directly compete with Tristan and his API, I will make mine only Cp5 compatible so people that want to develop widgets for both the Cp4 and Cp5 plateforms will still have to rely on Widget Factory. By the way, Tristan is aware of this and we have discussed that a few months ago.

So, come back and visit us in 2 or 3 weeks.  I’m actually advancing at a turtle pace since I don’t have that much free time on my hands.

Wednesday, 09 June 2010Posted by Whyves

My experiments with Captivate widgets was mainly at the Static and Interactive Widget levels. Tonight, I took a look at the Question Widget. In order to better understand the concept, I decided to recreate the JumbleWord Question Widget in AS3. Cp4 doesn’t have an AS3 version and it’s also missing from Cp5. So, I’m offering to the community a JumbledWord AS3 widget. While redoing it, I corrected some of the shortcomings of the AS2 version. If the question is incomplete, Captivate will not allow you to submit the question and once submitted, the tiles cannot be dragged anymore. I also improved the tiles dragging: you can now swap tiles in the word. If you drag a tile on top of an already placed tile, the previous tile will be kicked out of its current location. If I find some time, I will improve on the interactivity and if someone with good graphic skills comes across this widget and is interested to jazz it up a bit, contact me.

Tuesday, 18 May 2010Posted by Whyves

I just saw that Michael at www.cpguru.com has just released a post on the new widgets and the widget API. He did a nice presentation highlighting some of the new stock widgets that Cp5 will be offering. I will try to complement his post with some information I learned from my short exposure with the Widgets.

Development Language – AS3

As Michael pointed out, Widgets in Cp5 must be written in AS3. This might be a relief for some developers (including me :-) ) since they will not be asking themselves in which language they should develop their widgets. The downside is that by offering only AS3, some customers might be left alone with their legacy AS2 widgets and don’t have the means to convert all their old AS2 widgets to AS3. However, AS3 has been around for about 4 years now and Adobe had to make a move away from AS2 at some point. Lets just hope that this will not prevent people from moving to Cp5.

Backward Compatibility – Some Issues

Cp5 has been careful in trying to offer backward compatibility for Cp4 widgets. All the functions that were available in Cp4 are there in Cp5. However, there is one major difference that may cause your widgets (more…)

Sunday, 16 May 2010Posted by Whyves

Any developer will need, at some point, to debug his/her widget from within Captivate to see what’s really going on. Since we don’t have access to a debugger in Captivate, the next best thing is to trace outputs. Being a little bit lazy at time (but this can also be a good thing!), I never bothered much and used the Flash trace() function through a logging API. When you have the Flash Player Debug version, all the traces are written to a log file hidden somewhere in your local settings folder.

So, I used the same mechanism to investigate how widgets are working in Cp5 . However, to my surprise, the trace statements are only logged when you publish the project, not if you preview it. That’s strange since it used to work in both, preview and publish modes, under Cp4. It seems that the Flash Player now used for previewing projects from within Captivate is of a special kind. I have my own idea as to why they did that and I don’t mind at all since it will add some very nice functionality for widget developers … but this is for another post :P

They say that necessity is the mother of all inventions and I tend to believe this. I don’t want to have to publish my project to trace data so (more…)

Sunday, 18 April 2010Posted by Whyves

I noticed that some people don’t know how to access internal variables in Actionscript code. So, I tried to take some time to write a small tutorial about this. First, what I’m about to show you is applicable to both AS2 and AS3 but I’ll use AS3 to demonstrate it.

When you compile your movie using AS3, Captivate compiles a file called “CaptivateMaintimeline.as”. You can find this file on your hard drive in the Captivate installation folder under the “ActionScript 3.0″ sub-folder. If you open up that file, you will see declarations such as this:

(more…)