actionscript 3 - Loading Javascript in Flash (picture reference) -


i need help! want load picture url in flash as3 have following code in javascript shows picture. want load same reference in flash..

fb.api('/me?fields=username', function(response) {  function detect(url) {        var image = new image();        image.src = url;        image.onload = function() {        var result = 'result'; // example result     } document.body.appendchild(image) } detect("https://graph.facebook.com/" + response.username + "/picture?width=200&height=200"); 

you cannot call api as3 directly because facebook's library written in javascript. you'll have use js intermediary. however, gio's response above correct. use externalinterface api pass message js as. i'm pasting modifications need make in js below builds upon has written.

his answer correct , complete , should mark such.

fb.api('/me?fields=username', function(response) {  function detect(url) {        var image = new image();        image.src = url;        image.onload = function() {        var result = 'result'; // example result     }  // pasted gio's code above var swf = document.getelementbyid("myflash"); // reference swf.loadimage(myurl); // call as3 function } detect("https://graph.facebook.com/" + response.username + "/picture?width=200&height=200"); 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -