what should i do to combine this two programming language,but i want to run it in vb6.

Dani AI

Generated

A concise, practical follow-up that expands on the earlier suggestions from , , and the pointer from : three reliable approaches are (1) host the Flash Player OCX inside a VB6 form for tight integration and two‑way commands, (2) run the Flash projector/executable as a separate process (simpler deployment), or (3) host the SWF in an HTML page inside a WebBrowser control so the browser plugin handles rendering. The rest below gives concrete VB6 examples for the embedded approach plus common pitfalls and deployment tips that go beyond the short replies already posted.

Example: load a SWF at runtime and handle FSCommand callbacks (control named FlashCtl on the form)

Private Sub Form_Load()
    On Error Resume Next
    ' load the SWF into the embedded Flash control (level 0)
    FlashCtl.LoadMovie 0, App.Path & "\welcome.swf"
    FlashCtl.Play
End Sub

Private Sub FlashCtl_FSCommand(ByVal command As String, ByVal args As String)
    Select Case LCase(command)
        Case "closeapp"
            Unload Me
        Case "showmsg"
            MsgBox args
    End Select
End Sub

Passing data back and forth: use SetVariable / GetVariable from VB6 to manipulate ActionScript variables:

FlashCtl.SetVariable "_root.userName", "Alice"
Dim result As String
result = FlashCtl.GetVariable("_root.resultValue")

Troubleshooting & deployment tips:

  • Make sure the matching Flash OCX is registered on the development and target machines; VB6 apps are 32‑bit, so install 32‑bit player/OCX.
  • If the ActiveX approach fails on target systems, run the SWF as a projector EXE or host it in an HTML page inside the WebBrowser control to leverage the browser plugin.
  • FSCommand is best for small command strings; for richer data use variables or a file/IPC workaround.
  • Add simple error handling around COM calls and test paths with full filenames during debugging.

Note: Flash Player reached end of life; on modern systems it may be blocked. For long‑term projects consider migrating the UI to a supported technology.

Recommended Answers

All 6 Replies

what should i do to combine this two programming language,but i want to run it in vb6.

Does your flash already a movie or an executable one? one of my friend uses that flash for his welcome screen. if it does then you can load that to vb!

Does your flash already a movie or an executable one? one of my friend uses that flash for his welcome screen. if it does then you can load that to vb!

can u please give some example of code

I'm sorry I'm not familiar with it but ahmm I'm not sure huh but try it for yourself, add an object for flash or goto to components then add the object for flash then use the code Load(), that's what I remember he used. I can't try it here bcoz I have no flash installed in my comp...

ok thanks

If I can still remember...

Goto Add Components and add the Shockwave Flash...
if you can't see the Shockwave flash component click browse and then go to the folder where the Flash is installed and then search for its .ocx...

then to have a movie playing..
well do it for your self... I know you can do it.. Just the movie property...

Hi,

I think the Flash/VB article on may be helpful in this discussion.

This popular white paper is written by some engineering folks from our organization Mindfire Solutions (http://www.mindfiresolutions.com).

I hope you find it useful!

Cheers,
Byapti

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.