Passing data from script action to javascript

Does anyone know if I can transfer data from flash (action script) to java script? If so ... how?

(I need to send an ajax request with the text typed inside the text box from ActionScript).

0
source share
1 answer

You can use ExternalInterface to interact with JavaScript

import flash.external.ExternalInterface;
button_1.addEventListener(MouseEvent.CLICK, function(){ 
      ExternalInterface.call("myFunc", "param");
});

for some reason, I run into problems if I declare a JavaScript tag type='text/javascript'. therefore, I recommend using:

<script language='javascript'>
function myFunc(myparam){
      //your code
}
</script>
+1
source

Source: https://habr.com/ru/post/1793246/


All Articles