Sample: SWF-Storyline communication
Jun 20, 2012
This is a new thread based on part of this discussion about timers.
Here is a link to a game I built in Storyline that incorporates a countdown timer developed in Flash:
(sorry, I'm not permitted to share the .story file for this game; it was developed for a client)
The need for this timer came about when we discovered an issue with SL's built-in quiz timer. Here's a small zipped .story file that demonstrates the problem. Articulate couldn't say when they would have this corrected and I needed to get this game completed so we built our own timer functionality.
My associate, Marc Lee, wrote the timer code in Flash ActionScript 3. We used the information from an article on James' blog to implement the communication between Flash and SL. (Thanks James!) Note that the code from James' article is incorporated into the Flash file, not the .story file. The resulting .swf communicates variable values with Storyline. It's crucial that the variables you use to communicate between Flash and Storyline exist in both the .swf and the .story files and that they both are of the same type (number vs. text/string).
Here's a link to a Storyline demo of the timer; this zip includes a small .story file, a .swf file, and the timer .fla source file.
If you're a Flash AS3 coder, this may open a lot of possibilities with your SL projects! Send me a private message if you have any questions.
Steve Gannon
GanTek Multimedia
19 Replies
This is really, really, really awesome Steve. Loved the game and have already downloaded the demo/timer. Can't wait to put it into action.
I agree with Nancy, awesome project Steve!
Ditto, ditto. VERY nice.
Great project! Thanks for sharing
Very nice work! Will the AS3 coded timer work on iPads? Thanks.
It won't work natively on an iPad since the iPad does not support Flash (SWF) files. I haven't tried it but an iPad equipped with the Puffin browser or similar may enable it to work.
Thanks for the tip!
You're welcome, Steve.
Incidentally, the quiz timer bug mentioned in my original post at the top of this thread has since been corrected in the latest Storyline update. If I were to do the project again, I would use the built in quiz timer.
Sweet! Thanks again.
Nice work. Is the game is published in scorm ?
The link to the game in my initial post was published for the web for demonstration purposes. However, the real game is actually the final exam for a course and is published for SCORM so results can be tracked.
Hi Nikos! Just wanted to welcome you to E-Learning Heroes! Looks like you are already finding cool things here. Thanks for the update Steve!
Thanks for sharing the Timer. Very impressive. I do have a couple quick questions.
Is it possible to synch the timer with the slide time line? This way, when the time line is complete, the timer will automatically stop?
Is it possible to "pause" the timer? For example, if a user clicks a custom pause/play button (usually takes another slide layer), the timer will pause?
Regards,
Tom
Hi Tom,
The answer to both of your questions is "no", not as currently coded. But with some additional coding in Flash, this could be accomplished. Just thinking out loud, two triggers would be set up on each slide to toggle one of two True/False variables...when the timeline ends or when the slide is paused. When the variable value changes, the timer SWF would be notified and it would stop or pause, accordingly.
- Steve
Thanks Steve for the update, and glad to see this thread is still helping others.
Hi,
I'm trying to access "the article on Jame's blog" mentioned at the top of this post, but can't. The link isn't working. I know this thread is a bit old. Does anyone have a copy of this information? I'm trying to see to what extent Flash interactions can work within a Storyline 2 presentation.
Thanks!
Roger
Hi Roger!
I know that James has a newer venture, but I'm not sure of updated links. You are welcome to connect with him via the 'Contact Me' option on his user profile here.
Thanks!
Roger
I've sent him a message.
This discussion is closed. You can start a new discussion or contact Articulate Support.