I have been able to do this using a parent reference.
One "gotcha" is publishing locally to Flash player, the player is security sandboxed and you can't talk Flash <> Javascript without adding it to the security manager whitelist, publishing and uploading to a web host, or publishing to CD and testing using the exe wrapper.
Great you’ve had some success w/ this. It’s been bugging me for a week. I’ve had to do a round trip to SL through PHP and XML but it’s too much overhead.
The parent thing sounds promising. I’ll look forward to seeing your demo.
The attached works for me when published to CD, published for Web (with the Flash Security Settings whitelisted for the folder), and when published up to a web host. The webobject folder contains the file I added to the web object.
Hi Steve, thanks a lot for posting the example! Have you ever done the reverse, e.g. clicking a Storyline button displays text in a webobject? I should be able to figure this out myself, but I seem to have (script) writer's block today
I have done this in the past. You'd either need to publish once and get the iframe id or use some script in the iframe to pass the value back outside of the iframe and use that reference to push into the webobject. Have done this in the past with some sprite animation controls in a web object. Worked well.
Second thought on this one... you'd need to either use the querystring in the request or setup a listener to a variable change in the parent. I think that's the way I solved the animation speed control in a web object.
Getting window.frameElement.id from within the iFrame will grab the id of the current webobject. You could pass this back out to Storyline and use the reference to send a new URL into the iFrame.
Yes, Steve's code worked! Thanks for posting this. It turned out that communications from the webobject to SL was not really the problem. It was getting the event listener in Javascript working right to send the information to SL. Once that happened, parent.GetPlayer(SetVar) and (GetVar) worked perfectly in my webobject.
Also, Steve is again right that you can set up a listener in your webobject in Javascript to listen for a variable change in SL and, for example, pause your webobject animation from a button in SL. I have done both directions in my project.
Second thought on this one... you'd need to either use the querystring in the request or setup a listener to a variable change in the parent. I think that's the way I solved the animation speed control in a web object.
Getting window.frameElement.id from within the iFrame will grab the id of the current webobject. You could pass this back out to Storyline and use the reference to send a new URL into the iFrame.
OK - So this is my problem but I'm not quite good enough at JS to figure out what you mean. All I need to do in my web object is get the value in an SL variable. parent.getplayer() works, but only when publishing to HTML not to .exe which is what I need.
Can you dig up an example where the trip was the other way?
Are you attempting to run the file locally or from a Web server? If locally, the Flash Player Security feature would explain why communication between the Flash Storyline player and the browser is not working. To remedy:
1) Publish to CD to test locally, or
2) Upload to a Web server, or
3) Update your Flash Player Security Settings Manager to add your published folder location
Yes, Steve's code worked! Thanks for posting this. It turned out that communications from the webobject to SL was not really the problem. It was getting the event listener in Javascript working right to send the information to SL. Once that happened, parent.GetPlayer(SetVar) and (GetVar) worked perfectly in my webobject.
Also, Steve is again right that you can set up a listener in your webobject in Javascript to listen for a variable change in SL and, for example, pause your webobject animation from a button in SL. I have done both directions in my project.
Thanks again for everyone's interest!
-Marc L
Hi Marc,
Can you please give an example of how you set up a listener in the web object to monitor a change in a variable in Storyline. I want to be able to create a custom playbar on my slide which will control a Youtube video playing inside a web object. The idea is to use the Youtube IFrame API to play or pause the video when a button on the Storyline slide is clicked.
16 Replies
Hey Marc -
I have been able to do this using a parent reference.
One "gotcha" is publishing locally to Flash player, the player is security sandboxed and you can't talk Flash <> Javascript without adding it to the security manager whitelist, publishing and uploading to a web host, or publishing to CD and testing using the exe wrapper.
In all of my testing, it has worked in all browsers. I'll punch up a simple example this evening after dinner (couple of hours from now).
Steve,
Great you’ve had some success w/ this. It’s been bugging me for a week. I’ve had to do a round trip to SL through PHP and XML but it’s too much overhead.
The parent thing sounds promising. I’ll look forward to seeing your demo.
Thanks a million!
-Marc L
Hey Marc -
The attached works for me when published to CD, published for Web (with the Flash Security Settings whitelisted for the folder), and when published up to a web host. The webobject folder contains the file I added to the web object.
S
Thanks a bunch, Steve,
I'll dig into it and let you know what the results are. I really appreciate your offering to do this!
-Marc
Hi Steve, thanks a lot for posting the example! Have you ever done the reverse, e.g. clicking a Storyline button displays text in a webobject? I should be able to figure this out myself, but I seem to have (script) writer's block today
I have done this in the past. You'd either need to publish once and get the iframe id or use some script in the iframe to pass the value back outside of the iframe and use that reference to push into the webobject. Have done this in the past with some sprite animation controls in a web object. Worked well.
Second thought on this one... you'd need to either use the querystring in the request or setup a listener to a variable change in the parent. I think that's the way I solved the animation speed control in a web object.
Getting window.frameElement.id from within the iFrame will grab the id of the current webobject. You could pass this back out to Storyline and use the reference to send a new URL into the iFrame.
Thanks for the tips Steve, I'll give it a try.
All,
Yes, Steve's code worked! Thanks for posting this. It turned out that communications from the webobject to SL was not really the problem. It was getting the event listener in Javascript working right to send the information to SL. Once that happened, parent.GetPlayer(SetVar) and (GetVar) worked perfectly in my webobject.
Also, Steve is again right that you can set up a listener in your webobject in Javascript to listen for a variable change in SL and, for example, pause your webobject animation from a button in SL. I have done both directions in my project.
Thanks again for everyone's interest!
-Marc L
OK - So this is my problem but I'm not quite good enough at JS to figure out what you mean. All I need to do in my web object is get the value in an SL variable. parent.getplayer() works, but only when publishing to HTML not to .exe which is what I need.
Can you dig up an example where the trip was the other way?
Hi Steve,
I can't run your file in Chrome. It doesn't work parent.GetPlayer();
Hi Eimar -
Are you attempting to run the file locally or from a Web server? If locally, the Flash Player Security feature would explain why communication between the Flash Storyline player and the browser is not working. To remedy:
1) Publish to CD to test locally, or
2) Upload to a Web server, or
3) Update your Flash Player Security Settings Manager to add your published folder location
Hi Marc,
Can you please give an example of how you set up a listener in the web object to monitor a change in a variable in Storyline. I want to be able to create a custom playbar on my slide which will control a Youtube video playing inside a web object. The idea is to use the Youtube IFrame API to play or pause the video when a button on the Storyline slide is clicked.
Thanks in advance for your help.
Hi Rahul,
This thread is a bit older, so you may want to ping Marc directly using the "contact me" feature on his profile to reach out.
Sure, Ashley. Will do that. Thanks for the suggestion.
This discussion is closed. You can start a new discussion or contact Articulate Support.