Share Posted October 17, 2013 Hi there, I'm trying to add cuepoints to a video at runtime to display subtitles. I'm using a loop to get my cuepoints from XML and add them using the addASCuePoint method. But for some reason only the first 2 cuepoints seem to be displaying. Here is my for loop: for (var i:int = 0; i < subtitlesXml.cuePoint.length(); i++) { cuepointStart = subtitlesXml.cuePoint.attribute("substart"); cuepointEnd = subtitlesXml.cuePoint.attribute("subend"); subtitles = subtitlesXml.cuePoint.subtitle; videoLoader.addASCuePoint(cuepointStart, "substart " + i, {id:i}); videoLoader.addASCuePoint(cuepointEnd, "subend"); trace(cuepointStart + " " + cuepointEnd + " " + subtitles); } and here is my cuepoint listener: private function cuePointHandler(e:LoaderEvent):void { trace(e.data.name); if(e.data.name == "substart") { subTextField.text = subtitles[e.data.parameters.id]; } else if(e.data.name == "subend") { subTextField.text = ""; } else if(e.data.name == "break") { fadeOutVideo(); } } And here is my XML: <subtitles> <cuePoint id="0" substart="7.0" subend="11.0"> <subtitle><![CDATA[subtitle 1]></subtitle> </cuePoint> <cuePoint id="1" substart="16.0" subend="21.0"> <subtitle><![CDATA[subtitle 2]]></subtitle> </cuePoint> <cuePoint id="2" substart="22:0" subend="24:0"> <subtitle><![CDATA[subtitle 3]]></subtitle> </cuePoint> <cuePoint id="3" substart="26:0" subend="30:0"> <subtitle><![CDATA[subtitle 4]]></subtitle> </cuePoint> <cuePoint id="4" substart="31:0" subend="35:0"> <subtitle><![CDATA[subtitle 5]]></subtitle> </cuePoint> <cuePoint id="5" substart="36:0" subend="39:0"> <subtitle><![CDATA[subtitle 6]]></subtitle> </cuePoint> Any help would be appreciated. Cheers Gareth Link to comment Share on other sites More sharing options...
Author Share Posted October 17, 2013 What a fool! Sorry for wasting anyones time who bothered to read this. Syntax error in my XML! Link to comment Share on other sites More sharing options...
Share Posted October 17, 2013 Excellent. I was going to say that you're code looked solid. Thx for the update. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now