LocalConnections synchronized

  • jfbaro
  • Born
  • Born
  • No Avatar
  • Joined: Aug 07, 2006
  • Posts: 4
  • Loc: Liverpool
  • Status: Offline

Post August 7th, 2006, 9:42 am

Hi!

We have a localConnection calling a method in another SWF... that other SWF will send the value we need to carry on processing, but when we call send it goes to the next line, but the other SWF didn't sent the value yet...

Does actionscript has any kind of synchronization for "localConnection" or even a way of using a semafor?

Thanks in advance
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post August 7th, 2006, 9:42 am

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Joined: Nov 05, 2004
  • Posts: 1254
  • Loc: Ro
  • Status: Offline

Post August 8th, 2006, 5:07 am

local connection
so, what u have is:
Code: [ Select ]
varReceived = false;
incoming_lc = new LocalConnection ();
incoming_lc.methodToExecute = function (param) {
     varReceived = true;
};
  1. varReceived = false;
  2. incoming_lc = new LocalConnection ();
  3. incoming_lc.methodToExecute = function (param) {
  4.      varReceived = true;
  5. };


to sync, do this:

Code: [ Select ]
onEnterFrame = function()
{
  if (varRecived)
  {
   delete onEnterFrame;
   varReceived = false;
   gotoAndPlay(some_other_frame);
  }
}
stop();
  1. onEnterFrame = function()
  2. {
  3.   if (varRecived)
  4.   {
  5.    delete onEnterFrame;
  6.    varReceived = false;
  7.    gotoAndPlay(some_other_frame);
  8.   }
  9. }
  10. stop();
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 44 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.