We’re back from Devlearn! We had a great time meeting up with all of you over there and showing off our new widgets. Speaking of showing off our new widgets, let me show off our new widgets.
Have I sufficiently shown off our new widgets yet?
Good. Allow me now to show off something else.
There was a small issue that crept up for WidgetFactory in the latest patch for Captivate, so this release is mainly to resolve that issue. There are also a few new util classes if you’re interested, but the main new toy in this release is wildcards.
Okay, so here’s the problem. You want to work with slide objects right? However, you also want your widget to be placed on a Master slide. BUT, Master Slide objects don’t have item names right? RIGHT! And they still don’t. So… No I don’t have a solution for reliably grabbing master slide objects yet. HOWEVER, we now have a reliable solution for widgets on master slides grabbing objects on slides attached to that master slide.
Okay here’s the concept. You’ve built a mouse cursor widget. Well actually I’ve built a mouse cursor widget. I showed it off on the video above. But for the sake of argument you’re developing this mouse cursor widget. You place this widget on the master slide. You attach that master slide to every slide you want to display a custom mouse cursor on. Then on each attached slide you place the graphic that you wish to appear as the mouse cursor. However, in your widget you don’t want the user to have to define the item name for each object on each slide, so what you do is this: Give the cursor a name of ‘@_cursor’. Then for the mouse cursor graphics on each slide, add ‘_cursor’ to the end of the item name.
You may see where I’m going with this.
getSlideObject() now has an optional third parameter where you can specify a wildcard character. So let’s take the above example. To grab a slide object with a ‘_cursor’ syntax, you’d write it like this:
var myCursor:Sprite = getSlideObjectByName("@_cursor", -1, "@");
getSlideObjectByName will return to you the first object it can find that matches your wildcard name.
BUT! What if you wanted to get ALL the objects on slide that match your wildcard name? In that case, use the new getSlideObjectsByWildCardName() method (yes I know, it’s a long name). This function returns an array of slide objects that match your query.
var myCursors:Array = getSlideObjectsByWildCardName("@_cursor", "@");
In the above code, myCursors now contains an array full of every object on slide that has ‘_cursor’ at the end of its item name. This saves a lot of headache for your widget users and it’s not all that much of a pain to implement is it?
So try the new wildcard today!
I’ll be pretty busy working on our new widgets for a while. There may be another WidgetFactory release in the near future to clean up some issues that we’ve been receiving about review mode.
Also, since going to Devlearn we got a lot of requests for HTML5 versions of our widgets. Currently only static widgets can be built in HTML5 and we only have one up for sale at the moment. There are rumors going around that support for the other widget types will soon be added to Captivate. So if/when that happens, we’ll be jumping on the band wagon and releasing HTML5 versions of our Drag and Drop widgets pronto. And a HTML5 Drag and Drop widget is going to need a HTML5 WidgetFactory.
We’re also thinking of releasing more YouTube tutorials for Captivate. So it’s possible you may see less written blogs and more video training on developing widgets coming out here.
So that’s where I’m at! Have a good day and if you get the chance – eat a pineapple.