Skip to main content
emmau10371638
Inspiring
August 1, 2016
Answered

LocalConnection between main SWF and other SWF doesn't work!

  • August 1, 2016
  • 1 reply
  • 459 views

Hello, can somebody help me!!

I have one main SWF within several  SWF's. I want add the score from every level to the main SWF.

But I have also a code to unload every SWF before another SWF starts. I figured out how to do that.

But I don't know.

The code I have is something like this:

The level.SWF

stop();

var sending_score:LocalConnection = new LocalConnection()

    sending_score.send('_myConnection','add_score');

var App_Timer1:Timer = new Timer(100,1); //After 3 Seconds the timer causes the movie to jump to the next frame

App_Timer1.addEventListener(TimerEvent.TIMER_COMPLETE, startApp1);

App_Timer1.start();

function startApp1(event:TimerEvent):void {

   gotoAndPlay(105);

}

This topic has been closed for replies.
Correct answer kglad

you're welcome.

1 reply

kglad
Community Expert
Community Expert
August 1, 2016

localconnection allows communication between two swfs opened by one user at the same time.

it's not clear there is a receiving swf and, if there is, whether it's open at the same time as your send executed.

here's more info about swf to swf communication including how to use localconnection, SWF to SWF Communication when both swfs use actionscript 3.0

emmau10371638
Inspiring
August 10, 2016

tnx

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
August 10, 2016

you're welcome.