views:

311

answers:

3

Hi all

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

A: 

Check this tutorial

RaYell
+1  A: 

In AS3 Use ExternalInterface to add a javascript callback.

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

More details here

Brook
this seems very practical, i should try
Ahmet vardar
1120: Access of undefined property uploadFile. i am getting this error, sorry i am very new in actionscript
Ahmet vardar
A: 

Use ExternalInterface

Amarghosh