Dallas / Fort Worth Adobe User Group
Local Connection Issue
I uploaded a sample of a local connection onto a blank white page:
http://www.staggclan.com/test/localconnection/index.html
It has a “stop”, “play” and “rewind” button at the top in the buttons.swf and initially, as Mozart plays – if you press “play” or “stop” or “rewind”, then they behave as expected.
*The problem lies when you press rewind and THEN hit “stop” – the
button is not functional.
The code I have set up for STOP button on first frame is:
on (release) {
outgoing_lc = new LocalConnection();
outgoing_lc.send(“hello”, “test”, “stop”);
delete outgoing_lc; // drop the connection
}
The code I have set up for PLAY is:
on (release) {
outgoing_lc = new LocalConnection();
outgoing_lc.send(“hello”, “test”, “play”);
delete outgoing_lc; // drop the
connection
}
The code I have set up for REWIND is:
on (release) {
outgoing_lc = new LocalConnection();
outgoing_lc.send(“hello”, “test”, “rewind”);
delete outgoing_lc; // drop the connection
}
NOW – for the actual audio.swf, I have the following actionscript set up on first frame:
incoming_lc = new LocalConnection();
incoming_lc.connect(“hello”);
incoming_lc.test = function
(whatToDo)
{
if(whatToDo == “play”)
play();
else if(whatToDo == “stop”)
stop();
else if(whatToDo == “rewind”)
gotoAndPlay(1);
}
….for the life of me I can’t figure out why neither the “stop” buttons wouldn’t work after hitting rewind?
Your help on this matter is GREATLY, GREATLY appreciated. Feel free to reply offlist if so desired.
Sincerely,
Kevin
kstagg [at] gmail [dot] com
Related posts:
| Print article | This entry was posted by on February 26, 2007 at 5:48 pm, and is filed under Flash. Follow any responses to this post through RSS 2.0. Both comments and pings are currently closed. |
Comments are closed.








about 3 years ago
I haven’t used LocalConnect object before, but here’s a guess.
I’m making the assumption that the code you listed in your audio.swf file is all on frame 1. When you press rewind, the moving is going back to frame 1 and reinstantiating the incoming_lc object you defined in frame 1, and that might be causing your problem.
Trying changing your rewind case to “gotoAndPlay(2)”