PDA

View Full Version : LocalConnection in AS3


xt-ric
01-21-2008, 03:18 PM
I tried a communication between 2 hotspots (AS3 swf files)
So, i tried the localconnection class

I 've found this code on the forum
//Place the following in hotspot1:
var my_lc1:LocalConnection = new LocalConnection();
button_mc.onRelease = function(){
my_lc1.send("lc_name", "showClip");
}

//Place the following in hotspot2:
var my_lc2:LocalConnection = new LocalConnection();
my_lc2.showClip= function() {
aMovieClip._visible=0;
};
my_lc2.connect("lc_name");

I've converted this code in AS3
But when i click the button, FFP swith from fullscreen mode in normal mode and i get a Flash Player Error :
TypeError: Error #1009: Il est impossible d'accйder а la propriйtй ou а la mйthode d'une rйfйrence d'objet nul.
at TransitionEffect/::fadeLoaderAlpha()
at TransitionEffect/resize()
at Hotspots/doRender()
at Hotspots/::resizeHandler()

Is there anybody who have a working example of communication between 2 hotspots using LocalConnection in AS3 ??

xt-ric
01-22-2008, 09:17 AM
It will be nice if the communication between 2 hotspots is possible.

So, Denis, help us !

Scott Witte
01-22-2008, 07:58 PM
It will be nice if the communication between 2 hotspots is possible. Communicating between 2 hotspots isn't very hard although as with everything in Flash it is darn easy to make mistakes! :(

xt,

Have you checked out this thread?: communication between hotspots (http://flashpanoramas.com/forum/showthread.php?t=845)

Glancing at your code, why are you using ._visible=0 instead of .visible=0 ? Could that be your problem?

Are you using trace statements (and Flash Tracer) to figure out exactly what object is null? Since you are using localConnection you can easily test run each button from the development environment and get more precise debugging in the output window.

I assume "aMovieClip._visible=0;" is not intended as an FPP command but is executed in you SWF. Right?