Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to call actionscript function from javascript

I have a function like this in actionscript3

private function uploadFile(event:MouseEvent):void {
            var uploader:URLRequest = new URLRequest(serverUploadFile);
            localFile.upload(uploader);
        }

how can i call this function from javascript ?

thx

like image 551
Utku Dalmaz Avatar asked Nov 25 '25 00:11

Utku Dalmaz


2 Answers

In AS3 Use ExternalInterface to add a javascript callback.

ExternalInterface.addCallback("uploadFile", null, uploadFile);

More details here

like image 117
Brook Avatar answered Nov 27 '25 13:11

Brook


Use ExternalInterface

like image 42
Amarghosh Avatar answered Nov 27 '25 14:11

Amarghosh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!