I have a script to put multiple videos on one page, but play them one at a time, so I’m working on some examples before I begin. But I can’t get them to work is AS3, so I tried to see if I could do it in AS2, it works like a charm!! Can somebody show me what I’m doing wrong ???
Sender AS2 Code::
// Sender AS2 code : works
var listenerObject:Object = new Object();
listenerObject.stateChange = function(eventObject:Object):Void {
if (eventObject.state == "playing") {
var talker:LocalConnection = new LocalConnection();
talker.send("VideoToggle","Toggle");
txtBox3.text = "sent";
}
};
flvPlayer.addEventListener("stateChange",listenerObject);
Sender AS3 Code ::
//Sender AS3 code : broken
if(flvPlayer.VideoEvent.PLAYING_STATE_ENTERED){
var sender:LocalConnection = new LocalConnection();
sender.send("VideoToggle", "Toggle", true);
}
Then in the receiver :
// AS2 : works
txtBox.text = "txtBox ok";
//Listen for trigger, and then perform the function.
var listener:LocalConnection = new LocalConnection();
//talker.send("VideoToggle","Toggle");
listener.Toggle = function() {
txtBox2.text = "Toggled";
flvPlayer.stop();
};
listener.connect("VideoToggle");
AS3 no such luck
What went wrong ?
I got the AS3 cookbook & the whole wide web, and I can’t figure it out (I tried for like 16 hours) any help ???