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

Answers:

Answer

In AS3 Use ExternalInterface to add a javascript callback.

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

More details here

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.