Try again, but put an underscore in front of the name for both SWF's. "_swfConnect" instead of "swfConnect".
----- Original Message ----- From: "flexnewbie06" <[EMAIL PROTECTED]> To: <flexcoders@yahoogroups.com> Sent: Wednesday, July 26, 2006 1:59 PM Subject: [flexcoders] Re: Local Connection Jester, I have tried putting the local connection code in the main flex app and calling to the embedded SWF and this is the attempt at creating a second embedded swf (menu) to make the calls to the main SWF...either way if the swf is loaded at runtime...local connection is a no go. Thanks *****This is my menu.swf local connection code... #include "mc_tween2.as" stop(); var lcsend:LocalConnection = new LocalConnection(); play_btn.onRelease = function(){ lcsend.send ("swfConnect", "playFile"); } stop_btn.onRelease = function () { lcsend.send ("swfConnect", "stopandrestart"); } pause_btn.onRelease = function () { lcsend.send ("swfConnect" , "pauseFile"); } *****And this is the Main.swf local connection code var lc:LocalConnection = new LocalConnection(); lc.pauseFile = function() { stop(); } lc.resumeFile = function() { play(); } lc.stopandrestart = function() { gotoAndStop(1); } lc.playFile = function () { gotoAndPlay(1); } lc.getframeNum = function () { } lc.connect("swfConnect"); ******* --- In flexcoders@yahoogroups.com, "JesterXL" <[EMAIL PROTECTED]> wrote: > > Can you paste a snippet of your LocalConnection code in the Flash SWF? > > ----- Original Message ----- > From: "flexnewbie06" <[EMAIL PROTECTED]> > To: <flexcoders@yahoogroups.com> > Sent: Wednesday, July 26, 2006 1:02 PM > Subject: [flexcoders] Local Connection > > > I think I am going to go crazy over this. I have tried this a few > different ways and always ending with the same result...not working. > > I have 2 swf's loaded in my app with SWFLoader. They use local > connection to talk to each other. If i run app with swfloader with > no source and then dynamically set the swf source when something > happens in the app, local connection doesn't work. If i load the swf > in design the local connection works fine. For example Code 1 doesn't > work, Code 2 does...If you can lend a hand I would REALLY appreciate > it. > > Jenn > > ****************Code 1***************** > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > layout="absolute"> > <mx:Script> > <![CDATA[ > public function load():void { > mainswf.source = "file.swf"; > } > ]]> > </mx:Script> > <mx:Panel x="25" y="10" width="528" height="383" layout="absolute"> > <mx:SWFLoader id="mainswf" x="10" y="10" width="467" height="271"/> > <mx:ApplicationControlBar x="10" y="0" width="539" height="60"> > <mx:SWFLoader id="menu" source="menu.swf" width="499" height="58"/> > </mx:ApplicationControlBar> > </mx:Panel> > <mx:Button click="load()" id="loader" x="25" y="445" label="Button"/> > </mx:Application> > > > **********Code 2*************** > > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > layout="absolute"> > <mx:Panel x="25" y="10" width="528" height="383" layout="absolute"> > <mx:SWFLoader id="mainswf" source="file.swf" x="10" y="10" > width="467" height="271"/> > <mx:ApplicationControlBar x="10" y="0" width="539" height="60"> > <mx:SWFLoader id="menu" source="menu.swf" width="499" height="58"/> > </mx:ApplicationControlBar> > </mx:Panel> > <mx:Button click="load()" id="loader" x="25" y="445" label="Button"/> > </mx:Application> > > > > > > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Search Archives: http://www.mail-archive.com/flexcoders% 40yahoogroups.com > Yahoo! Groups Links > -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/