LocalConnection and attachMovie...



  • 1. loadMovie but buttons underneath still active
    Hi all AS gurus... I have struggled with this for quite some time now; Whenever I load a movie on top of another movie using the loadMovie command ...the buttons of the movie underneath still show (the mouse turns to the hand) & create a lot of problems... as they can still be clicked!!!!! How can this be avoided?
  • 2. getURL oh so slow!
    I am developing a web site that is 95% flash - loadinf .swf files on the fly. However, I need to be able to load the occasional html page into a blank window. I am using the code: myButton_btn.onRelease = function(){ getURL("myFile.htm","_blank"); }; This works but when the link is clicked a new window opens and there is then a delay of up to 2 minutes before the contents of the page STARTS downloading. During this wait the new window effectively hangs. Once the new contents starts to download it does so at the normal speed. It does not matter if this is the first time using the link or if I am revisiting. I am using Flash MX 2004 Pro on a Windows XP platform and Internet Explorer as my default browser. The same happens with both dial-up and DSL connections Anyone got any ides. David Merritt
  • 3. ActiveX controls in Flash
    Hi, Can anyone tell me how to host ActiveX controls in Flash ? Thx in advance
  • 4. Need ActionScript for Popup HTML page
    Hi - Please help. I need the action (FLASH MX) for a html page to be able to pop-up when a button is clicked on my flash site. I know its out there. Can someone please post the actionscript. thanks a bunch!

LocalConnection and attachMovie...

Postby yarkehsiow » Sat, 05 May 2007 00:23:02 GMT

 in the first (sending) swf is this code:
 	var nChosen:Number=1;
 	var sending_lc:LocalConnection = new LocalConnection();
 sending_lc.send("lcNumber", "methodToExecute", nChosen);
 	var nChosen:Number=2;
 	var sending_lc:LocalConnection = new LocalConnection();
 sending_lc.send("lcNumber", "methodToExecute", nChosen);

 and in the recieving .swf:
 // Code in the receiving SWF file
 this.createTextField("result_txt", 1, 10, 10, 100, 22);
 result_txt.border = true;
 var receiving_lc:LocalConnection = new LocalConnection();
 receiving_lc.methodToExecute = function(nChosen:Number) {
 	this.attachMovie("circle"+nChosen, "circle", this.getNextHighestDepth(), 
{_x:180, _y:18});
                      result_txt.text = nChosen;


 the textField properly displays nChosen, but the movieClip is not attaching 
(yes, the linkage name is set up, they are circle1 and circle2)

 help appreciated thanks!

Similar Threads:

1.LocalConnection() with 3 or 4 swf's

For any given "connection name", there can be only one receiver but multiple senders.

Your approach is correct but here's an idea to make it more flexible - have your broadcasting movie have a connection that collects the names of connections for each of the other movies - each would "register" itself when it starts up.  The broadcasting movie would then send the broadcast to each of those connections.

2.Where are LocalConnection objects stored?

Shared objects are saved to disk in a .sol file. Where are
LocalConnection objects stored?

3.Localconnection question

Must the 2 swf files that are communicating be openned before they talk to each other?

In other  words can I have only one swf and then  when a button is pressed the receiving swf file will be openned with the data passed from the first swf to it?  At that point I'll have 2 swf files.


4.LocalConnection objects to send and receive data within a single SWF file

from Tutorial:

LocalConnection objects to send and receive data within a single SWF file, but this is not a standard implementation;

Plase give me Example.

5.Looking for LocalConnection source

On the old actionscript-toolbox.com site there was a sample flash movie that 
used two popup windows that used LocalConnection to talk to one another.  In 
the sample you coudl grab a ball and throw it and when it went off stage on 
one window it would appear on the second window.  Does anyone know of 
another source for this download?


6. Help with LocalConnection Object

7. Please help with localConnection syntax

8. SharedObject and LocalConnection hates each other

Return to FLASH


Who is online

Users browsing this forum: No registered users and 25 guest