Solved

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

Posted on 2008-10-29
4
1,695 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…

770 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