I found out that it is possible to call external javascript
in an browser with my interactive .swf
document using the ExternalInterface provided by Adobe. That means, that with e. g. button clicks I can trigger javascript
commands (yes, I am aware of the media9
mediabuttons.) However, that doesn't seem to be possible in an LaTeX-generated .pdf
, as one can only import the .swf
document itself without the additional js-commands.
If that weren't the case, I could connect my .swf
to media9
and therefore to other interactive graphics as well.
Is there a workaround or another possibility to achieve this?
EDIT: Let's add an example: Connect the hslider
from this example to media9.
EDIT: Extend that example:
This is the slider in mxml
:
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
initialize="init();">
<mx:Script><![CDATA[
public function change():void {
flash.external.ExternalInterface.call("anim[’my_anim’].frameNum = 10","");
}
]]></mx:Script>
<mx:HSlider id="aSlider" width="100%"
minimum="0.1" maximum="3" value="0.1"
dataTipPlacement="top"
snapInterval="0.01" tickInterval="0"
labels="[a=0.1,3]"
allowTrackClick="true"
liveDragging="true"
change="change();"/>
</mx:Application>
As you can see, it should, for the sake of simplicity, just set the frameNum
of another animation my_anim
(created with the animation
package) to 10
. However I can include this .swf with media9 without any problems, but there is no response to sliding.
What I am doing is probably nonsense, but my intention should now be clear.
media9
package are controlled in exactly the same way as you describe, that is, through methods exposed to JavaScript via the ExternalInterface. Bi-directional communication is possible. Can you post a specific example? Otherwise, your question is too broad.VPlayer.swf
frommedia9
does. Its Flex source code is here: mirrors.ctan.org/macros/latex/contrib/media9/players/… .