Nov 21, 2009

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

free web hosting
Open Discussion > Xisto Network Sites > The GFXTrap Forum - Trap17 Graphics Site > Other > Animation/Flash

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

round
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

Comment/Reply (w/o sign-up)

wow
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

Comment/Reply (w/o sign-up)

epox
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!

 

 

 


Comment/Reply (w/o sign-up)

sanbeand
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");

Comment/Reply (w/o sign-up)

round
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

Comment/Reply (w/o sign-up)

wow
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.

Comment/Reply (w/o sign-up)

round
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

Comment/Reply (w/o sign-up)

FeedBacker
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

Comment/Reply (w/o sign-up)

FeedBacker
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

Comment/Reply (w/o sign-up)

(G)Lupo
Link to a certain frame in a flash movie
Getting Two Flash Movies To Communicate

Hi,

I have a similar problem...
I have a page consisting of two flash movies, one with a scroll function and one picture gallery. Now I would like the gallery movie to start at different frames depending of which thumb in the scroll I click... But I'm stuck! I can just get it to start at frame 1 all the time... Anyone who knows what to 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


Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : flash, movies, communicate, communicating, flash, movies

  1. My First Flash Application
    Jump over a wall (4)
  2. Flash Halloween Quiz - Can You Pass It?
    An interesting Flash Halloween Quiz, know more about Halloween (6)
    Halloween is coming... Do you want to know everything about Halloween? Take the Halloween Quiz now
    >> I didn't pass it. /sad.gif" style="vertical-align:middle" emoid=":(" border="0"
    alt="sad.gif" />....
  3. A Sig I Made In Flash Cs3
    (3)
    I used Photoshop CS3 and Flash CS3 to make this. I think it looks good and has an interesting
    function to it for a sig. It's simply a clock in signature form. Clock Sig ....
  4. A Short Film In Flash.
    Made for a friend. (3)
    Well I made this little flash movie for a great friend of mine just because I knew she would like
    it. You won't get a lot of the inside jokes scattered around but I thought I would still share
    it with my mates over here. The reason I made it for her is because she broke her foot and was in
    the hospital for a bit. I choose the characters because for one her name is CancerPony, I call her
    Pony; and two one of her favorite foods it Vegemite when she lived back in New Zealand. So I hope
    you enjoy it! http://www.damen.trap17.com/pony.html I love me some vegemite. I am....
  5. Funny Flash Quiz.. It Makes Me Laugh.. Lol.. (for Boys Only)
    My friend created this flash and ask me to play it. Guys, it really fu (11)
    It's really funny guys.. LOL Gay Test ....
  6. Flash Menu
    (3)
    i decided to make a cool menu for one of the skins for my website.
    http://switchfoot.ifastnet.com/index4.php check out the menu on the left hand side (3 different
    flash files) and it's really cool the top on e is a simple animation, the middle one are
    rollover links and the last one is a motion tween which stops when you hover over it also on this
    menu http://switchfoot.ifastnet.com/menu.swf what can i do to make it more interactive?....
  7. Eddy Block Head --flash--
    (2)
    Author: KuBi Time To Complete: 2 hours Download: http://www.sepiasfx.net/e107/download.php?view.5
    Man, this was really hard, for a first time. I kept messing up with the animations, giving him 4
    arms instead of 2 arms, rotated in the other direction. First time, nothing special. Don't
    expect much /tongue.gif" style="vertical-align:middle" emoid=":P" border="0" alt="tongue.gif" />.
    Just download the file off my site, then unzip it, and open up the .html file. Make sure the .swf
    and .html are always in the same folder, so they work properly. Enjoy /smile.gif" st....
  8. My Flash Sig
    (5)
    I made a new flash sig. I really think this is awesome, to embed your own flash sig into your
    signature. Only bad thing is that every forum has disabled the .swf extension and/or the HTML tags,
    sigh why is this? Flash is about 100x's better than using crappy old GIF. I think its time we
    roll into the new level of animation sigs, a.k.a. flash. Here is my flash sig:
    http://www.finalchapter.uni.cc/forum/showt...d.php?p=3#post3 Its really simple and fun to do. This
    took me very little effort so imagine what could be accomplished with flash SIGS! In the near
    future ....
  9. Make People Dl Flash Player 8
    (7)
    Does anybody know any code I could put on the actionscript or in the html that will make the visitor
    to a webpage download flash player 8 in case he doesnt have it? All I have found so far is this 1000
    line javascript code, but I wouldnt want to use that, anybody know another way around it? Thanks.....
  10. New Flash Template.
    (6)
    This template will replace my previous template/site. Let me know what you think. (there is only 1
    working button) So its just a basic outline. Template Rate Please. ~Lucias O`Neil Edit as per
    request. Warning issued for signing off ....
  11. Flash Animation
    My bands new Flash video (4)
    Hi guys, its me again. Its been a long time since I post another animation, and I know I promised I
    would put up some tutorials, but Ive been very busy last semester so I really didnt have time to
    make some quality tutorials worth putting up here, but I promise I will starting next week or so.
    Some friends asked me If I could teach them flash, and I will, and the material I make for those
    classes I will translate and put up here on the Trap17 forums first than on any other page
    /biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /> . So you can ....
  12. Can You Get Flash In Stores?
    (7)
    I mean like a physical store, not a site. My parent's won't buy stuff over the internet for
    me. /sad.gif' border='0' style='vertical-align:middle' alt='sad.gif' /> If it's not then
    I'll just have to wait a few years, which by then I won't need flash.....
  13. As Flash.. _root
    a simple question (3)
    Is _root relative to the scene or the overall flash movie? for example if i have this:
    _root.getBytesTotal will that return the total bytes of my movie (.fla) or just the current scene?
    thanks!....
  14. Delay X Seconds In Flash
    how to action script that (2)
    How do i have to do, to tell a frame to wait x seconds after it continues playing? In Macromedia
    Flash, of course... Like: CODE stop(); "wait  x seconds"; play(); Thanks....
  15. Homestarrunner.com
    flash cartoon site (1)
    Who has been to the site? I know it's kind of old, but it's pretty entertaining. I think
    the most popular part of the site is the 'Strongbad Email' section. Any comments on the
    site.....
  16. Random Flash Animation
    (6)
    I was really bored so i made this: http://img155.imageshack.us/my.php?image=beepbeep5yx.swf What
    do you guys think?....
  17. My Flash Site
    please rate (15)
    Well, i've put together a random site, to see if people like how the site flows. The main site
    is only a homepage template so far. Please tell me if you like it or not from 1 to 10. Flash Site
    ....
  18. Flash Page Header
    (12)
    Here is a Flash page header I made for an online roleplaying game. I personally didn't like it
    because it made the pages too slow to load, especially if you have a modem connection like me. But
    it's what the customer wanted and once again a web designer was at the mercy of his customer.
    /sad.gif' border='0' style='vertical-align:middle' alt='sad.gif' /> I know the dragon is a bit
    funky when it walks but I had to limit the number of frames in an effort to try to keep the file
    size down. Obviously this was a "Dungeons & Dragons" type role palying game, hence ....
  19. Check Out My Animation
    FLaKes's Flash animation (13)
    Hi, I just wanted to share my animation with you guys, so tell me what you think about it. Its at :
    Mr Chorro animation Its the one called Mr Chorro. I just wish the 2020 animation had not been sent
    this month but oh well, if you like my animation please vote for it. Im open for all types of
    criticism, thanks for any replies.....
  20. Flash Site?
    help (12)
    How do you make a full flash site? can someone help me?....

    1. Looking for flash, movies, communicate, communicating, flash, movies

Searching Video's for flash, movies, communicate, communicating, flash, movies
See Also,
advertisement


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

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com