Solved

how to call a Active X control from flex. i heard it can be done with Embedd tag is that true.?

Posted on 2009-05-07
3
418 Views
Last Modified: 2012-05-06
Hi i am new to Flex. i have a requirement where i need to call an Active X control component from flex.
how is it possible to call ? can i have a sample code and possible examples which demonstrate it.?
0
Comment
Question by:kotlapraveen
  • 2
3 Comments
 
LVL 10

Expert Comment

by:mplord
ID: 24332126
Assuming the ActiveX control is embedded in your web page?

Mock it up using Javascript first. Anything you can do using Javascript in the web page to talk to the ActiveX control can be extended to be called from Flex easily through ExternalInterface.

If you can provide a Javascript example, I can provide a Flex example to make the bridge.
0
 

Author Comment

by:kotlapraveen
ID: 24333575
Here is my sample java script code which creates the folder in c directory with the help of active X control

<script type="text/javascript">
     var fso = new ActiveXObject("Scripting.FileSystemObject");
     var a = fso.CreateFolder("c:\\new folder");
</script>
0
 
LVL 10

Accepted Solution

by:
mplord earned 500 total points
ID: 24336744
First turn this into a Javascript function:

<script type="text/javascript">
function createFolder(folder)
{
     var fso = new ActiveXObject("Scripting.FileSystemObject");
     var a = fso.CreateFolder(folder);
}
</script>

From Flex:

                  import flash.external.ExternalInterface;

                  ...

                  if ( ExternalInterface.available )
                  {
                        ExternalInterface.call("createFolder", "c:\\new folder");
                  }
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface   In the first 100 days of the Macintosh release in January 1984, Apple sold 72,000 of the computers. Relatively cheap, easy-to-use personal computer with a graphical operating system. I've never seen this model. I did see this one:   …
CocoaPods is the best way to manage library dependencies in iOS and OS X projects. By using cocoa pods there is no need of downloading the code from github and copying to your project. There are plenty of open source libraries now available with C…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question