Target Dynamic Text Field in Video Skin
Hello,
I am new to FLVPlayback and Video skins and I was hoping someone could help me out. I have a flvPlayback instance named fpp and am using a skin I modified from those provided by Adobe. All is working fine, the skin shows up over the video, autohides on mouse out, etc. What is killing me is attempting to get the video time into the skin
IE. Elapsed Video Time / Complete Video Time
I am able to get these values in my flvPlayback.fla using the following ActionScript 3 code:
var fullDuration:String = "";
function metadataReceivedF(e:MetadataEvent):void {
fullDuration = prettyTime(fpp.metadata.duration);
};
function updateF(e:VideoEvent):void {
var paTime = fpp.playheadTime;
time_txt.text = prettyTime(fpp.playheadTime) + " / " + fullDuration;
};
fpp.addEventListener(MetadataEvent.METADATA_RECEIVED, metadataReceivedF);
fpp.addEventListener(VideoEvent.PLAYHEAD_UPDATE, updateF);
function prettyTime(timeinSeconds:Number):String{
var seconds:Number = Math.floor(timeinSeconds);
var minutes:Number = Math.floor(seconds/60);
seconds %= 60;
minutes %= 60;
var sec:String = seconds.toString();
var min:String = minutes.toString();
while(sec.length < 2) {
sec = "0" + sec;
}
while(min.length < 2) {
min = "0" + min;
}
return min + ":" + sec;
}
What I can not figure out is how to get this time information into my dynamic text field in the skin. I have tried numerous ways to target this textfield to no avail. The instance name of my dynamic text field on my skin is: time_txt. Not sure if this is helpful but my skin swf name is simply videoSkin.swf.
Can anyone please help me out with targeting this text field from my root flvplayback.fla actionscript. Thanks a lot.