How can I send a variable on flash animation to Storyline ?
Apr 20, 2018
By
Sunny Park
Hello. I am new of Storyline.
I am struggling to find a way how to communicate flash and storyline 2
I found similar questions, but I am not able to use the code.
What I want to implement is once the user clicks a button on the flash file, the story line slide change the next slide.
I am not familiar with Action script3 now.
Would you please help me to find a solution?
Please explain me detail how it works
Thanks.
3 Replies
I put the script on flash
import flash.external.ExternalInterface;
_button.addEventListener(MouseEvent.CLICK, buttonClickHandler);
function buttonClickHandler(event:MouseEvent):void{
//grab the current value from Storyline and increase it by one
var valueIn:int=ExternalInterface.call('GetPlayer().GetVar','goNextSlide');
valueIn++;
//send a new value to Storyline
ExternalInterface.call('GetPlayer().SetVar','goNextSlide',valueIn);
}
Hi Sunny,
Your code looks fine only and just make sure you are using a server to test the build.
Flash action script wont communicate with storyline if you test the build through a local machine,
https://www.apachefriends.org/download.html
Hi Sinchu,
It works perfectly.
Thanks a lot! I appreciate your help :)
This discussion is closed. You can start a new discussion or contact Articulate Support.