Celebration!
Yes fellow widget builders, there be a new version of WidgetFactory for us to sink our… keyboards… into…
It’s a release candidate. Which means I’m pretty sure there are no serious bugs, but I’m covered if there are.
Click here to get WidgetFactory 5.1 Release Candidate 1!
5.1 has been in the works for a long time and it took a lot of effort and hard work and blah blah blah bla- FEATURES!
New Features
Almost Unlimited Slide Access
Previously, WidgetFactory allowed you access to the slide the widget was located on. Now however, widgets can now access ANY slide in the Captivate Movie.
There is one limitation though: The slide must have been loaded by Captivate. So if your widget is on slide 1 and is trying to access slide 500, that slide may not exist yet. However, as soon as that slide has been created, it will be made available to you, and in Captivate 5 they tend to load very fast.
With that in mind, let’s take a look at the new tools:
getSlide(slide number or label)
Returns the slide (a MovieClip) with the number or label that you pass in. Yes that’s right, you can search by slide label! But only in Captivate 5 and above.
1 2 3 | var slideOfInterest = getSlide("My Slide Label"); // slideOfInterest now holds the slide with the label of My Slide Label, // assuming there is such a slide. |
gotoSlide(slide number or label)
Makes the move jump to the slide with the number or label that you pass in. Slide labels can only be used with Captivate 5. BTW: The slide loading limitation mentioned above does not apply to this method.
1 2 | gotoSlide(6); // The Captivate movie will move to slide six. |
currentSlide
This property gives you access the slide that the user is currently watching. Useful if you’ve got a widget which is set to display for rest of project (more on that later).
getSlideObjectByName(object name, slide)
This method has been in WidgetFactory since Version 1.2. By passing a string into getSlideObjectByName() you could (and still can) access any object on the widget’s slide. However, now there’s an optional second parameter which defines which slide the object will be retrieved from. This is done by (you guessed it) passing in that slide’s number or slide label. Once again: slide labels + Captivate 4 = no-no.
1 2 3 | var slideObjectOfInterest:Sprite = getSlideObjectByName("HipHighlightBox", 3); // slideObjectOfInterest now holds the highlight box called HipHighlightBox located on slide 3. // assuming such an object (or slide) exists. |
Passing in the slide’s MovieClip would also work. So if you plug currentSlide into the second parameter, the search will be directed to the slide being currently viewed.
Remember, this is an optional parameter. If you leave it out, the search will default to the widget’s slide.
Widget Information
Ever wanted to know whether the Captivate Author attached a sound to your widget? Or whether the widget has a fade in or fade out animation? Or how many failure criterias the Captivate Author has allowed for your Interactive Widget?
Well the new widgetInfo property (available on each widget class) holds a whole slew of information on how the widget has been set up. Here are the various properties and information you can access on widgetInfo.
Frame Numbers
- widgetInfo.startFrame
- widgetInfo.endFrame
- widgetInfo.hasFadeIn
- widgetInfo.hasFadeOut
- widgetInfo.totalFadeInFrames
- widgetInfo.totalFadeOutFrames
- widgetInfo.fadeInEndFrame
- widgetInfo.fadeOutStartFrame
Interactive Widgets
- widgetInfo.pauseFrame
- widgetInfo.pauseForCaptions
- widgetInfo.maxAttempts
- widgetInfo.continueAfterSuccess
- widgetInfo.continueAfterFailure
Widget SWF’s Original Size
- widgetInfo.originalWidth
- widgetInfo.originalHeight
Misc
- widgetInfo.hasInitialVisibility
- widgetInfo.isSynchronizedWithProject
- widgetInfo.widgetSlideNumber
- widgetInfo.hasAudioAttached
- widgetInfo.initialAlpha
- widgetInfo.isDisplayedForRestOfProject
For more information on each of these tidbits of information, see the WidgetInfo class in documentation.
Various Other Features
isInAggregator
Sometimes widgets that work in normal Captivate don’t work so well when the Captivate Movie is included in an Aggregated Project. Especially if the widget plays around with the TOC, Closed Captioning, or Playbar.
This property will be true if the widget is inside an aggregator. Using this in conjunction with an if statement, you can change how the widget works when it’s inside an aggregator.
isFirstRuntime
I promised to add this to the next version of WidgetFactory, and so I did. When runtime is first dispatched, it will be true. Whereas after that, it will be false. This post explains why this is useful.
quizData
Now you can access information on the quiz setup when responding to the WidgetEvent.INTERACTIVE_ITEM_SUBMITTED event, or the QuestionWidgetEvent.QUESTION_SUBMITTED event, through the event object’s quizData property.
1 2 3 4 5 6 | addEventListener(QuestionWidgetEvent.QUESTION_SUBMITTED, onQuestionSubmitted); private function onQuestionSubmitted(e:QuestionWidgetEvent):void { e.quizData; } |
Here’s a list of all the information you can access:
- quizData.slideNumber
- quizData.questionNumber
- quizData.questionType
- quizData.questionAnswered
- quizData.questionAnsweredCorrectly
- quizData.questionMaxScore
- quizData.questionScore
- quizData.questionMaxAttempts
- quizData.questionAttempts
- quizData.interactionID
For more information on this, see the documentation under the QuizData class.
WidgetPropertiesRawData
If anyone has been using the widgetPropertiesRawData property (which I seriously doubt), be advised that has now been moved to the new WidgetInfo class and renamed to widgetPropertiesXML.
enterMovie()
The enterMovie() Template Method now works consistently in Captivate 4.
Bug Fixes
Along with the new, there is also the repairing of the old. If you’ve come astray of any of these little insects, be reassured they’ve now been extracted:
- Widgets no longer prevent the Captivate Movie from resizing. As noted here.
- Static Widgets now work when set to display for rest of project.
- In CP4, closing down the Widget Properties dialog without going to the Widget Parameters tab no longer results in the Widget Properties being forgotten.
- Corrected misspelt parameter in the QuestionWidgetEvent class.
- triggerSubmitProcess() no longer requires the submit button to be on stage to work.
- Various behind the scenes clean up.
I hope that’s given you some new toys to play with. Be warned, I have much more planed… SO MUCH!
If you have any feature requests, please let me know and I’ll see what I can do to include them.
Until next time, I bid thee farewidget!








