permort
09-24-2009, 11:28 AM
I canīt figure out how to communicate between these two .swf-files.
The first file, "coordinates.swf" is tracking the coordinates and play/pause my flv-videos. The second file, "flvPLayer.swf" is playing the flv-file.
What I want to do is to play/pause the video when the pano is between spesific coordinates.
My question is:How do I call the "playVideo" function in "flvPlayer.swf" from "coordinates.swf"?
Here is my code so far. This is from "coordinates.swf":
if (coordinate < -95 && coordinate > -170) {
//Here I want to call the "playVideo" function in "flvPlayer.swf"
} else {
//Here I want to call the "pauseVideo" function in "flvPlayer.swf"
}
This is some code from "flvPlayer.swf". I have paused at frame 1 so itīs not starting when loaded:
function connectStream():void {
stream = new NetStream(connection);
stream.client = this;
stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
video = new Video(375, 225);
vid.addChild(video);
video.attachNetStream(stream);
stream.play(file);
stream.seek(1);
stream.pause();
}
function playVideo() {
stream.resume();
}
function pauseVideo() {
stream.pause();
}
The first file, "coordinates.swf" is tracking the coordinates and play/pause my flv-videos. The second file, "flvPLayer.swf" is playing the flv-file.
What I want to do is to play/pause the video when the pano is between spesific coordinates.
My question is:How do I call the "playVideo" function in "flvPlayer.swf" from "coordinates.swf"?
Here is my code so far. This is from "coordinates.swf":
if (coordinate < -95 && coordinate > -170) {
//Here I want to call the "playVideo" function in "flvPlayer.swf"
} else {
//Here I want to call the "pauseVideo" function in "flvPlayer.swf"
}
This is some code from "flvPlayer.swf". I have paused at frame 1 so itīs not starting when loaded:
function connectStream():void {
stream = new NetStream(connection);
stream.client = this;
stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
video = new Video(375, 225);
vid.addChild(video);
video.attachNetStream(stream);
stream.play(file);
stream.seek(1);
stream.pause();
}
function playVideo() {
stream.resume();
}
function pauseVideo() {
stream.pause();
}