They are awesome questions Fabrice. Can't really help you with the first question because I have not tried it yet, but you should be able to use JavaScript to send values to Storyline from Flash as well as from Flash to Storyline.
As for your third question, you are correct in that you can't use triggers to control objects within the swf, but you can place objects (such as an invisible button or sympol) on top of a swf and they can have triggers.
The possibility to communicate with flash variables through javascript would enhance Storyline's power in a limitless extent. (for instance, you use a swf menu to control the slides and so on). I have to try harder to possibly succeed if it is doable.
if some members of the community have same expectations an goals... great.
yes, yes, yes, but when you place an object above a swf movie you lose the interactivity inside the flash object (rollover, click...).
I suspect once the SDK is released, this type of communication should be clarified.
For now:
Using a variable listener, you should be able to catch a change to a JavaScript variable from an SWF (SWF to SL communication). This requires you to create the variable in SL.
Polling a Javascript variable through Flash using ExternalInterface should enable you to send commands to a Flash file through Javascript variable values. This will require that you use a JavaScript trigger to update a JS variable.
I agree with Fab, facilitating datacommunication between SL and embedded SWFs as well as webobjects in the iframe would make SL borderless and very powerful indeed.
With this in place anyone could add on their own flash "plug-ins" to create whatever feature, functionality one could ever want.
I'm also looking for a solution to this, has one been found yet? I seem to remember someone saying that there is no API to do this in Storyline as with Studio Presenter '09. Is this correct?
This is all good and I guess you could build a Flash-based menu navigating through slides using conditions on variable changes:
You then need to setup one of these for each menu option.
Please let me know if you need more help.
What I am looking for, however, is either local variables (local to object, ie. SWF, or layer) or a way to pass parameters to each of the flash objects i have on the slide.
For instance:
I have three boxes with a textfield made in Flash which are all the same and I would like to pass different texts to each of them.
(The alternative would be three almost identical flash files with just the variable inside the flash different which sounds like a really bad idea. Especially when the result is to maintain dozens of flash files which work exactly the same way)
This is all good and I guess you could build a Flash-based menu navigating through slides using conditions on variable changes:
You then need to setup one of these for each menu option.
NOTE: To be more clear and to be consistent - the above snapshot should handle variable fromFlash of course.
Please let me know if you need more help.
What I am looking for, however, is either local variables (local to object, ie. SWF, or layer) or a way to pass parameters to each of the flash objects i have on the slide.
For instance:
I have three boxes with a textfield made in Flash which are all the same and I would like to pass different texts to each of them.
(The alternative would be three almost identical flash files with just the variable inside the flash different which sounds like a really bad idea. Especially when the result is to maintain dozens of flash files which work exactly the same way)
Only way to do this currently is by polling GetVar from within the Flash file. Setting up an interval call ExternalInterface with a callback, maybe every second, should grab the value from Storyline as it's updated.
Hello, currently dealing with an issue that the above suggestions seem to be a solution however i unable to get it to work.
I have a swf file that has some interactions and and at some point in the swf i would like to have it trigger SL to go to the next slide. I have the following in my AS3 file:
//Section 3// Section3.addEventListener(MouseEvent.CLICK, Start_Section3); function Start_Section3(event:MouseEvent):void { var fromFlash:String = "Hello from Flash"; ExternalInterface.call('GetPlayer().SetVar','fromFlash',fromFlash); } //---------//
when they click the Section3 button it should execute the communication between flash and SL (as per the above sample.)
in SL i have the following trigger:
(attached as well)
When i run the SL project and click the button in flash, nothing happens.
I even have a text field on screen with " %fromFlash% " in the field and notice that it does not change when the button is clicked.
from what i can find online, there may be a JS file needed to bridge the communication. I do not know JS well, or at all really.
I am at a bit of a standstill here, any help or a point in the right direction would be appreciated.
Hi, David -- Thanks for reaching out with your question! I wanted to share that JavaScript is not something for which we would be able to provide support, so hopefully some of the JS gurus in the community can chime in to assist you further. Here also is our JS Best Practices sheet if you'd like to check it out.
One other thing to note, as this is an older thread and some of the participants may no longer be subscribed, is that you are welcome to reach out to participants directly using the 'Contact Me' link on an individual's profile page if you wish. :)
15 Replies
Great questions Fabrice !
Fabrice
They are awesome questions Fabrice. Can't really help you with the first question because I have not tried it yet, but you should be able to use JavaScript to send values to Storyline from Flash as well as from Flash to Storyline.
As for your third question, you are correct in that you can't use triggers to control objects within the swf, but you can place objects (such as an invisible button or sympol) on top of a swf and they can have triggers.
Thank you Nancy.
(for instance, you use a swf menu to control the slides and so on). I have to try harder to possibly succeed if it is doable.
if some members of the community have same expectations an goals... great.
For the transparent button, I was thinking it could be used more for pure Flash animations that don't have interactivity.
You might want to do a search on JavaScript in this forumn. There have been a few posts that might point you in the right direction.
Check out the reversi example in this post http://community.articulate.com/forums/t/12421.aspx
I suspect once the SDK is released, this type of communication should be clarified.
For now:
Nothing automatic. But certainly possible.
Nancy and Steve... thank you for your encouraging answers.
if it is possible... it makes SL borderless.
fab
Any news or example code on this?
I agree with Fab, facilitating datacommunication between SL and embedded SWFs as well as webobjects in the iframe would make SL borderless and very powerful indeed.
With this in place anyone could add on their own flash "plug-ins" to create whatever feature, functionality one could ever want.
Cheers,
/L
Can I use swf menu to control the slides in SL? Thanks for you help
Hi
I'm also looking for a solution to this, has one been found yet? I seem to remember someone saying that there is no API to do this in Storyline as with Studio Presenter '09. Is this correct?
Thanks
Hi
Communication between SL to Flash and reverse is no problem.
You use the ExternalInterface in Flash to call the SL players GetVar and SetVar methods in both cases.
Example:
// [AS3 code]
// The following will GET a variable in SL, set a Actionscript variable and set the text for an instance named "itxt" (on stage)
var toFlash:String = ExternalInterface.call('GetPlayer().GetVar',"toFlash");
if(toFlash) itxt.text = toFlash;
// The following will SET a variable in SL from Flash
var fromFlash:String = "Hello from Flash";
ExternalInterface.call('GetPlayer().SetVar','fromFlash',fromFlash);
//[AS3 code END]
This is all good and I guess you could build a Flash-based menu navigating through slides using conditions on variable changes:
You then need to setup one of these for each menu option.
Please let me know if you need more help.
What I am looking for, however, is either local variables (local to object, ie. SWF, or layer) or a way to pass parameters to each of the flash objects i have on the slide.
For instance:
I have three boxes with a textfield made in Flash which are all the same and I would like to pass different texts to each of them.
(The alternative would be three almost identical flash files with just the variable inside the flash different which sounds like a really bad idea. Especially when the result is to maintain dozens of flash files which work exactly the same way)
Anyway to accomplish that?
BR,
Björn Cronqvist
Hi Björn -
Only way to do this currently is by polling GetVar from within the Flash file. Setting up an interval call ExternalInterface with a callback, maybe every second, should grab the value from Storyline as it's updated.
Hello, currently dealing with an issue that the above suggestions seem to be a solution however i unable to get it to work.
I have a swf file that has some interactions and and at some point in the swf i would like to have it trigger SL to go to the next slide. I have the following in my AS3 file:
//Section 3//
Section3.addEventListener(MouseEvent.CLICK, Start_Section3);
function Start_Section3(event:MouseEvent):void
{
var fromFlash:String = "Hello from Flash";
ExternalInterface.call('GetPlayer().SetVar','fromFlash',fromFlash);
}
//---------//
when they click the Section3 button it should execute the communication between flash and SL (as per the above sample.)
in SL i have the following trigger:
(attached as well)
When i run the SL project and click the button in flash, nothing happens.
I even have a text field on screen with " %fromFlash% " in the field and notice that it does not change when the button is clicked.
from what i can find online, there may be a JS file needed to bridge the communication. I do not know JS well, or at all really.
I am at a bit of a standstill here, any help or a point in the right direction would be appreciated.
Thanks
Hi, David -- Thanks for reaching out with your question! I wanted to share that JavaScript is not something for which we would be able to provide support, so hopefully some of the JS gurus in the community can chime in to assist you further. Here also is our JS Best Practices sheet if you'd like to check it out.
One other thing to note, as this is an older thread and some of the participants may no longer be subscribed, is that you are welcome to reach out to participants directly using the 'Contact Me' link on an individual's profile page if you wish. :)
This discussion is closed. You can start a new discussion or contact Articulate Support.