Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

local connection

Explorer ,
Jun 22, 2009 Jun 22, 2009

this is uni directional ... correct ?

so .. its necessary to create a localconnection object in both the parent and child swf if bi directional comm is desired ??

so ..

in parent ..

var cc:LocalConnection = new LocalConnection()
cc.allowDomain("*")
cc.client = this

var cc2:LocalConnection = new LocalConnection()

in child loader handler ...

cc.connect("_cCom")

in child maintimeline

var cc2:LocalConnection = new LocalConnection()

cc2.allowDomain("*")
cc2.client = this

in child unload routine in parent

cc2.close()

removeChild(getChildByName(ChildName))

===========================

the child is loaded and unloaded multiple times ..

the 1st time .. no issues ..

everytime thereafter when the child is loaded .. I get ..

"ArgumentError: Error #2082: Connect failed because the object is already connected."

when the child is unloaded ..

"ArgumentError: Error #2083: Close failed because the object is not connected."

seems like the connection is persistant until the child is instantiated ... or am I doing something obviously wrong ???

TOPICS
ActionScript
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 22, 2009 Jun 22, 2009

yes, it's uni-directional.

so, if you need two-way communication you need a send and receive lc in both swfs.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 22, 2009 Jun 22, 2009

in essense that what i did ... did I not ???

any thoughts on the errors ?

the code seems to work ... but the errors are causing a on every other / and bizarre play back of the child behavoiur  ...

see .. http://www.dbrenchley.com/resume/Resume.html

move the cursor in and out of the video frame a couple of times and note how the transport controls load ...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 22, 2009 Jun 22, 2009

no, you didn't.  you'll need code similar to that below though you'll need excute the receiving lc's before the senders send.

swf1:

var sendLC:LocalConnection = new LocalConnection();

sendLC.send("conn1", "swf2F");

var receiveLC:LocalConnection = new LocalConnection();

receiveLC.client = this;

receiveLC.connect("conn2");

function swf1F(){


}

in swf2:

var sendLC:LocalConnection = new LocalConnection();

sendLC.send("conn2","swf1F");

receiveLC.client = this;

receiveLC.connect("conn1");

function swf2F(){

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 22, 2009 Jun 22, 2009
LATEST

unless I'm a total dolt ... and I have often overlooked the obvious w/ my transition to AS3 ..

My logic is essentally the same .. save I did not include the conn.send statements ... though they exist in the actual code.

If you viewed the link ..

one LC .. is from the transport to main to control playback ..

the second LC is to position the volume slider w/ the current value ...

the code works ... it just presents a arguement error ... seemingly every other time ...

thats what I'm having difficulty seeing ...

I'll attach the fla's ... if your up to taking a look ..

============================================

hmmmmm ... guess I won't .... keeps stripping them from the message ...

Message was edited by: Brenchley_1

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines