|
|
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 | |||
![]() |
|
|
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
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!
load the other two in the loader like:
_root.loadMovie("thenameofthefirstmovie");
_root.loadMovie("thenameofthesecondmovie");
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
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
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
Similar Topics:
Flash Media Into Html/css Website
Flash Vs. Html
Multiple Languages Used In A Senten...
My Ol' Game (8)
|
(7) Can You Get Flash In Stores?
|
Loading...
HOME 






