Using ActiveX / OCX Component in Flash with Action Script

Posted on 2005-04-16
Last Modified: 2007-12-19
I have a Magtek credit card reader. It included an ActiveX / OCX component and VBScript sample code. Can I use the ActiveX control in Flash MX with ActionScript? If so please give an example.

Here is a short VB.NET Example of using the component.

Start Component with Public WithEvents KbdWedge As AxKbdWedgeOCX.AxKbdWedge
      Private Sub KbdWedge_CardDataChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles KbdWedge.CardDataChanged
            Dim Status As Object
        KbdWedge.PortOpen = False
        txtFirst.Text = KbdWedge.GetFName()
            txtLast.Text = KbdWedge.GetLName()
            txtPAN.Text = KbdWedge.FindElement(2, ";", 0, "=")
            txtMonth.Text = KbdWedge.FindElement(2, "=", 2, CStr(2))
            txtYear.Text = KbdWedge.FindElement(2, "=", 0, CStr(2))
            Call KbdWedge.ClearBuffer()
        KbdWedge.PortOpen = True
      End Sub

I need to do the above with ActionScript in FlashMX if possible.

Question by:brian2k1
    LVL 18

    Expert Comment

    I don't think you can.

    LVL 18

    Accepted Solution

    you can embed the flash into an app designed with c++, visual c++ vb6, delphi etc, (using the flash.ocx), and work through it that way - passing vars between the 2 parts of the app, but on flash itself I don't think possible.


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
    While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
    The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
    The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

    746 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

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now