Loading...


bookmark - Getting Two Flash Movies To Communicate communicating between two flash movies

Getting Two Flash Movies To Communicate - communicating between two flash movies

 
 Discussion by round with 9 Replies.
 Last Update: November 10, 2008, 4:57 am
 
bookmark - Getting Two Flash Movies To Communicate communicating between two flash movies  
Quickly Post to Getting Two Flash Movies To Communicate communicating between two flash movies w/o signup Share Info about Getting Two Flash Movies To Communicate communicating between two flash movies using Facebook, Twitter etc. email your friend about Getting Two Flash Movies To Communicate communicating between two flash movies Print
Reply / Comment New Discussion / Topic Share / Bookmark E-Mail a Friend Print

I'm just wondering if anyone here has tried or gotten two flash movies to communicate. I'll explain. If say you had an html page which had two embeded flash movies, can you or have you gotten the two to communicate between each other. I realise that i could just create one really huge flash movie of the site and make it work that way but i want the flash header to do something everything another flash movie gets to a certain place. I have been able to control flash movie from text files, and throught links on pages but i've not been able to get different to control each other. Not sure how to start this one. Anyone have any ideas?round






   Mon Oct 31, 2005    Reply         

Hi, round
I would like to see your fla file on that.Flash makes a communications server you can get the developers version for free at the macromedia web site it will let you connect to another flash movie.If your trying to connect over the web you must run the communications server within an http server from what Ive red about it also smartfox makes a portable gamming server that will do the same.Ive tryed both, but I havnt yet tryed going public yet

   Mon Oct 31, 2005    Reply         

well, there is a not at all easy way to do what you want. In ActionScript 2.0 there is an object called LocalConnection that allows two SWF files to send instructions to each other, without external code snippets like javascript.

this litle example will show you how to communicate two differents swf files, even if they are openned in different windows.

CODE

// This is the reiciving swf:

//creation of the textfield to display what other swf tells
this.createTextField("info_txt", 1, 10, 10, 100, 22);
info_txt.border = true;

//definning the object local connection
var receiving_lc:LocalConnection = new LocalConnection();
receiving_lc.showInfo = function(n1:Number, n2:Number)
{
    info_txt.text = n1+n2;
};
receiving_lc.connect("lc_name");


The following SWF file sends the request to the first SWF file.


// the sending SWF:

var sending_lc:LocalConnection = new LocalConnection();
sending_lc.send("lc_name", "showInfo", 5, 7);



ok, as you see, you make your two swf files, one that reicives information, and one that sends it. first, in the reiciving swf you define a LocalConnection object configured to recieve information and do something with it with the functions you define, note that you can add the amount of functions that you want. After you would define the chanel in which the swfs will communicate, you make it with -receiving_lc.connect("lc_name"); -line

Now you have the reiciving swf, but you need the swf who will tell the reiciving swf what to do, in the code are two single lines that make that, and it's not hard to understand, first you define a sending localConnection object, and then tell it that communicate with other swf in a common channel, in this case the same channel for the reiciving swf("lc_name"),and then invoke the method you want in the reiciving swf with its respective parameters to execute.

this is a basic usage of localconnection object, because it has more useful methods and features, like restrict which dns can acces to your swf and security options. May be you can find helpful the flash docummentation, just type LocalConnection, and press f1 key over it, and it will display the class deffinition with its methods descriptions.

i hope you find it useful!

   Mon Oct 31, 2005    Reply         


well i think u can set up a new swf and add some code to include the other two swf u want to be communicated and as now those two and the "loader" make one u can communicate easily without having problems...BUT u must be careful in calling this, _root and _parent because now the _root belongs to the "loader"

load the other two in the loader like:
_root.loadMovie("thenameofthefirstmovie");
_root.loadMovie("thenameofthesecondmovie");

   Tue Nov 1, 2005    Reply         

thanks for the reply. I'm looking into the LocalConnection commands, seems to be what i'm looking for. The reply just above wasn't what i was looking for. I can do that but it involves creating one really huge swf file and putting that on the page. i was just trying to see if i could get two different flash files like banners to communicate with each other. It might make a page much more interactive.round

   Thu Nov 3, 2005    Reply         

Hey , round did you get the two to talk yet? Looks like you ,and sanbeand are the only ones that Ive found in trap working with flash. I would be intrested seeing what you come up with.Also I'm looking to make new contacts with people that are using the flash IDE . I've been working on building a chat ap.

   Fri Nov 18, 2005    Reply         


I haven't posted any files yet, got side tracked on another project and flash movie.Will pm you the second i have something worthwhile to show. Willing to share any fla files with people.round

   Sun Nov 20, 2005    Reply         

i want to run two swf file in another swf file as a banner how i will do it
Getting Two Flash Movies To Communicate

I am making a banner in that I need to run another swf file as a product list on right side how I will do it. I am just new in action script
If any one know it pls mail me that will be helpful for me.

-reply by Anulasingh

   Wed Feb 13, 2008    Reply         

how to communicate 2 different flash movie??
Getting Two Flash Movies To Communicate

Ok.. I'll make it simple.. I'm new at this whole flash thing.. and I've got a few question to ask..

How can I called a .Swf movie from another .Swf movie??
Right now I'm using adobe flash cs3..


-question by siti

   Wed Mar 26, 2008    Reply         

Link to a certain frame in a flash movieGetting Two Flash Movies To Communicate

Hi,I have a similar problem...I have a page consisting oftwo flash movies, one with a scroll function and one picture gallery.Now I would like the gallery movie to start at different framesdepending of which thumb in the scroll I click... But I'm stuck! I canjust get it to start at frame 1 all the time... Anyone who knows whatto do?The script looks like this:ItemList.Thumb3._alpha = 65;ItemList.Thumb3.OnRollOver = function() {Tweener.AddTween(this, {_alpha:100, time:0.6});};ItemList.Thumb3.OnRollOut = function() {Tweener.AddTween(this, {_alpha:65, time:0.6});};ItemList.Thumb3.OnRelease = function (){_parent.LoadGallery.LoadMovie("gallery1.Swf");}I would like to put in something like gotoAndStop(3)in the last line...-reply by Lupo

   Mon Nov 10, 2008    Reply         

Quickly Post to Getting Two Flash Movies To Communicate communicating between two flash movies w/o signup Share Info about Getting Two Flash Movies To Communicate communicating between two flash movies using Facebook, Twitter etc. email your friend about Getting Two Flash Movies To Communicate communicating between two flash movies Print
Reply / Comment New Discussion / Topic Share / Bookmark E-Mail a Friend Print

Similar Topics:

Flash Media Into Html/css Website

Hi I need some help , Im designing this website for school studies However, I made a flash drop down menu, works perfectly, but you know how flash has a background when you export it in to a SWF file? For example my flash is width= 800, and height = 200 but my div box on my ...more

   06-Jun-2008    Reply         

Flash Vs. Html

Hey all, I have a question. Being that this is all based on personal opinion, feel free to share how you feel. I would also love to know *why* you feel that way. The question is regarding websites, and their setup. The first part of it is regarding "flashing&quo ...more

   24-Dec-2008    Reply         

Multiple Languages Used In A Senten...

Hey Guys, I noticed today after I met a few different types of friends and the way I was communicating with them. We have a big garden very close to my apartment where I ask people to meet me. But today I met about 3 different people there and I also had good conversation with them indi ...more

   23-Mar-2010    Reply         

My Ol' Game    My Ol' Game (8) (7) Can You Get Flash In Stores?   Can You Get Flash In Stores?