Solved

how can i send variables between flash actionscript 3 and c# and vice versa

Posted on 2008-10-29
4
1,690 Views
Last Modified: 2013-11-11
I am trying out Flash CS3 to decide if I should upgrade from Mx but I have run into problems.  As I have done many times before, I have loaded my flash files into a c# form using the flash activex control.  At first it seems to work just the same as with Mx, until I try to pass variables to and from the flash.  I have tried looking up how to make actionscript 3 recive and send variables between flash and c# but have got more an more confused.  I keep reading about Flash's fantastic external api features but I can't find an example of how to use it.

Can any of you experts out there help me out and tell me where I can find a reliable, (an hopefully simple), example of how to communicate between flash cs3(actionscript 3) and c#?
0
Comment
Question by:Susurrus
  • 2
  • 2
4 Comments
 
LVL 39

Accepted Solution

by:
blue-genie earned 500 total points
ID: 22843945
hi there. i was just looking at externalInterface with C# today. I have to do a project next month with it, though its still in AS2. the last time i worked with a c# wrapper was in AS1 with fscommands.

i found the help file most useful for explaining how i would go about it.
have you looked there. i know its a lot of boring reading but there's a full code example there with explanations and possible security issues etc.'

oh it just occured to me. you said you haven't upgraded so you won't have access to the help file.. arggh.

the sample files can be found here.
www.adobe.com/go/learn_programmingAS3samples_flash.
0
 

Author Comment

by:Susurrus
ID: 22844787
yep, thats my problem.  It is a little bit chicken an egg.  I want to evaluate the new as3 to see if it can do what I want before I commit to the upgrade, but before upgrading I cant get all the information I want.  Also there  doesnt seem to be a lot out on there generally yet about c# and as3 interaction.  Alll the examples I have found are AS2. I will do as you suggest though and try going through some of the samples and see if i can find anything useful.
0
 

Author Comment

by:Susurrus
ID: 22846729
Its working!

After going through the samples I found an example project called "IntrovertIM_CSharp" which put me on the right lines.   My biggest problem turned out to be that i was using an  outdated flash active x control dll.  Once I got this sorted out, the communication proved to be fairly easy.

The most simple example of interaction between as3 and c#  is here

http://www.richapps.de/articles/externalinterface_part1/

 (it is written for flex users but it was easy enough to pull out the actionscript I needed)
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 22847620
yeah i think i'm going to go with the flex approach since i just need to pop in an existing swf file.
will see. good luck to us both
:-)
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

758 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

17 Experts available now in Live!

Get 1:1 Help Now