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
No related posts.











#1 by Anonymous on March 28, 2007 - 3:04 pm
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)”