Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrating VB.NET with Flash in Visual Studio 2015 (Community)

I'm currently in the middle of making a VB.NET project. I want to have the VB.NET project control the actions of the Flash projector. (Stop, play, change text of text control in the Flash projector, etc.) This is a one way control however, nothing about the SWF projector will interact back with the VB.NET project.

The image below shows an idea of what I want to have done.

Ideal goal of application

EDIT: Okay I managed to get a SWF object available to be put in the project. So now, my question is how do I get the two (Visual Studio and the SWF object that is being included in another form windows) to interact. That is, if I push a button on VisualBasic, I can call a function in AS3/SWF to do something and receive a variable from the Visual Basic form.

The AS3 code contains the following

function fl_ClickToGoToWebPage(event:MouseEvent):void
{
    lblText.text = "Congrats! It Works!";
}

btnChange.addEventListener(MouseEvent.MOUSE_UP, fl_ClickToGoToWebPage);

Here is a photo of the actual SWF.

Mock SWF

What I would like to do is invoke this function (or some similar function) passing info to the SWF projector (being run as an ActiveX Flash object in Visual Studio) from the VB form. (Ignore the button on the actual SWF, that button won't be there on the final run) I'm running into two problems:

1) How do I modify addEventListener so that it can take more than one parameter or is there another event or function I could use?

2) How do I invoke this function from within Visual Studio as a part of a sub or function from within VS/VB.NET?

I don't need it to reciprocate, as in Visual Studio getting information from the SWF.

like image 996
Paul Williams Avatar asked Sep 26 '22 11:09

Paul Williams


People also ask

Is VB.NET open source?

VB is part of the open-source wave at Microsoft, so as Wischik observes, the VB compiler will be open source as part of the project codenamed Roslyn.

What is Visual Studio NET IDE?

Visual Studio is an Integrated Development Environment(IDE) developed by Microsoft to develop GUI(Graphical User Interface), console, Web applications, web apps, mobile apps, cloud, and web services, etc. With the help of this IDE, you can create managed code as well as native code.

Is it possible to write or create VB.NET programs in Linux operating system or Mac OS?

Writing VB.Net Programs on Linux or Mac OS Mono is an open-source version of the . NET Framework which includes a Visual Basic compiler and runs on several operating systems, including various flavors of Linux and Mac OS.

Is Visual Basic C#?

Though C# and VB.NET are syntactically very different, that is where the differences mostly end. Microsoft developed both of these languages to be part of the same . NET Framework development platform. They are both developed, managed, and supported by the same language development team at Microsoft.


1 Answers

I just ran a quick test using sendkeys and it worked ok; at the heart of it was:

setting the flashplayer as the foreground window ...

Friend Declare Function SetForegroundWindow Lib "user32" (ByVal hWnd As IntPtr) As Integer

and then using the sendkeyes command

System.Windows.Forms.SendKeys.SendWait

like image 150
Rob Avatar answered Sep 29 '22 00:09

Rob