Hey Ramiro. I probably will implement greensock's VideoLoader, but for now, as a quick fix, I went an manually figured out the time codes for my cuepoints.
So partA of videoAssetMINE starts at 0 seconds, part B at 45.2, partC at 130.8 seconds and so forth.
When my partA, partB, partC buttons are clicked, the Number variable seekVal is set to the corresponding number/time in seconds (0, 45,2, 130.

.
Trace statements show that this is registering properly.
Then, in my play function, if the video's id coresponds to this particular lengthy FLV, I want to seek to the seekVal time so I can play partA, partB, or partC depending on which button was clicked.
The buttons always trigger the movie to play from the beginning however.
Not sure what I'm doing wrong. Code is pasted below:
if(id == "videoAssetMINE") // note that id corresponds to the FHIntro below
{
trace("id = " + id + " and if that's videoAssetMINE will then seek to seekVal of " + seekVal);
ns.seek(seekVal);
}
ns.play();
trace("E here setting asset video's vol, pan, play and pause and netstream stuff");
When that didn't work, I tried moving the seek higher up in the playVideo function as follows:
private function playVideo(id:String):void
{
//PREVIOUS if statements here then relevant code:
else if (videoClickedName == "FHIntro")
{
trace("here setting asset video's vol, pan, play and pause and netstream stuff - videoAssetOfThisPage = " + videoAssetOfThisPage + " and myVideoId = " + myVideoId);
trace("id = " + id + " and if that's videoAssetFHTH1 will then seek to seekVal of " + seekVal);
INetStream(Gaia.api.getPage(videoAssetOfThisPage).assets[myVideoId]).volume = 1;
INetStream(Gaia.api.getPage(videoAssetOfThisPage).assets[myVideoId]).pan = 0;
[b]INetStream(Gaia.api.getPage(videoAssetOfThisPage).assets[myVideoId]).seek(seekVal);[/b]
INetStream(Gaia.api.getPage(videoAssetOfThisPage).assets[myVideoId]).play();
INetStream(Gaia.api.getPage(videoAssetOfThisPage).assets[myVideoId]).pause();
trace("B here setting asset video's vol, pan, play and pause and netstream stuff");
//trace("using " + myVideoId);
INetStream(Gaia.api.getPage(videoAssetOfThisPage).assets[myVideoId].addEventListener(NetStatusEvent.NET_STATUS, onNetStreamStatus, false, 0, true));
INetStream(Gaia.api.getPage(videoAssetOfThisPage).assets[myVideoId].addEventListener(NetStreamAssetEvent.CUEPOINT, onMyCuePoint, false, 0, true));
trace("C here setting asset video's vol, pan, play and pause and netstream stuff");
}
else
{
//code for other videos
}
trace("D here setting asset video's vol, pan, play and pause and netstream stuff");
if(!id) id="videoAsset1";
currentVideoID = id;
trace("currentVideoID = " + currentVideoID);
//var ns:INetStream = assets[id] as INetStream;
prepareVideo();
trace("back from prepareVideo - will now play video with ns.play()");
ns.play();
trace("E here setting asset video's vol, pan, play and pause and netstream stuff");
}
This is the code I have in my prepare video function. I don't know if this is somehow telling flash to play from the beginning instead of the seekVal I implemented above. Do I need to place my seek function down here after this ns is created? Or does seek simply not work the way I'm trying to use it.
public function prepareVideo():void
{
ns = Gaia.api.getPage(videoAssetOfThisPage).assets[id] as INetStream;
if (ns)
{
ns.attach(myVideo);
Gaia.api.getDepthContainer(Gaia.MIDDLE).addChild(myVideo);
addVideoBtns();
}
}
Thanks for any help.
(also tried
ns.play(seekVal)
instead of just ns.play() but video still starting from the beginning)