jquery - passing javascript variable value to swf in fdt -


i new in fdt, want pass javascript variable value fdt code. have no idea how it.

html code:

<a id="player" href="javascript:void(0)" data-id="02">abcd</a> 

javascript code:

$('.list a').click(function(){    var id = $(this).data("id"); } 

in fdt, id 02 there swf file link.

or there way it? please me.

thanks in adcance.

you need use externalinterface in swf, catch function calls javascript

import flash.external.externalinterface;  if (externalinterface.available){     externalinterface.addcallback("changetext", changethetext);  }  function changethetext(t:string):void {     txttext.text = t; } 

javascript code

var flashobj = document.getelementbyid('flashobject'); <a href="#" onclick="flashobj.changetext('it works!');">click me!</a> 

example here: http://www.hardcode.nl/archives_155/article_334-call-javascript-function-from-as3-and-viceversa.htm

search google "javascript/as3 bridge"


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -