<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flex Examples &#187; playheadTime</title>
	<atom:link href="http://blog.flexexamples.com/tag/playheadtime/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adding ActionScript cue points using the CuePointManager</title>
		<link>http://blog.flexexamples.com/2007/08/01/adding-actionscript-cue-points-using-the-cuepointmanager/</link>
		<comments>http://blog.flexexamples.com/2007/08/01/adding-actionscript-cue-points-using-the-cuepointmanager/#comments</comments>
		<pubDate>Thu, 02 Aug 2007 06:21:40 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[CuePointManager]]></category>
		<category><![CDATA[VideoDisplay]]></category>
		<category><![CDATA[cue points]]></category>
		<category><![CDATA[playheadTime]]></category>
		<category><![CDATA[totalTime]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/01/adding-actionscript-cue-points-using-the-cuepointmanager/</guid>
		<description><![CDATA[<p>I was just playing around with the VideoDisplay.cuePointManager property, and made a pretty crude FLV player. The FLV URL is hard-coded, so it really isn&#8217;t very useful, but it shows how you can use the cuePointManager property and addCuePoint() method to add ActionScript cue points to an FLV.</p> <p>Full code after the jump.</p> <p></p> &#60;?xml [...]]]></description>
			<content:encoded><![CDATA[<p>I was just playing around with the <code>VideoDisplay.cuePointManager</code> property, and made a pretty crude FLV player. The FLV URL is hard-coded, so it really isn&#8217;t very useful, but it shows how you can use the <code>cuePointManager</code> property and <code>addCuePoint()</code> method to add ActionScript cue points to an FLV.</p>
<p>Full code after the jump.</p>
<p><span id="more-45"></span></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/08/01/adding-actionscript-cue-points-using-the-cuepointmanager/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            [Bindable]
            private var FLV_URL:String = "http://www.helpexamples.com/flash/video/cuepoints.flv";

            private function videoDisplay_addCuePoint(evt:MouseEvent):void {
                var cpTime:String = videoDisplay.playheadTime.toFixed(3);
                var cpName:String = 'cp' + (parseFloat(cpTime) * 1000);

                videoDisplay.cuePointManager.addCuePoint({name:cpName, time:cpTime});

                lbl.text = videoDisplay.cuePointManager.getCuePoints().length + " cue point(s)";
            }

            private function toggleVideoPlayback():void {
                (videoDisplay.playing) ? videoDisplay.pause() : videoDisplay.play();
            }

            private function updateProgressBar():void {
                progressBar.setProgress(videoDisplay.playheadTime, videoDisplay.totalTime)
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Label text="Click video to begin playback" /&gt;

    &lt;mx:Panel title="{FLV_URL.split('/').pop()} ({videoDisplay.totalTime.toFixed(2)})" id="panel" visible="false"&gt;
        &lt;mx:HBox&gt;
            &lt;mx:VBox&gt;
                &lt;mx:VideoDisplay id="videoDisplay" source="{FLV_URL}" autoPlay="false" ready="panel.visible = true" cuePointManagerClass="mx.controls.videoClasses.CuePointManager" click="toggleVideoPlayback()" playheadUpdate="updateProgressBar()" /&gt;
                &lt;mx:ProgressBar id="progressBar" width="{videoDisplay.width}" mode="manual" label="{videoDisplay.playheadTime.toFixed(2)} / -{(videoDisplay.totalTime - videoDisplay.playheadTime).toFixed(2)} (%3%%)" /&gt;
            &lt;/mx:VBox&gt;
            &lt;mx:VBox&gt;
                &lt;mx:DataGrid id="dataGrid" width="{videoDisplay.width}" height="{videoDisplay.height}" dataProvider="{videoDisplay.cuePoints}" change="videoDisplay.playheadTime = event.currentTarget.selectedItem.time" /&gt;
                &lt;mx:HBox width="100%"&gt;
                    &lt;mx:Button label="add cue point" click="videoDisplay_addCuePoint(event)" /&gt;
                    &lt;mx:Label id="lbl" width="100%" textAlign="right" /&gt;
                &lt;/mx:HBox&gt;
            &lt;/mx:VBox&gt;
        &lt;/mx:HBox&gt;
    &lt;/mx:Panel&gt;

&lt;/mx:Application&gt;
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Adding ActionScript cue points using the CuePointManager on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/08/01/adding-actionscript-cue-points-using-the-cuepointmanager/',contentID: 'post-45',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'cue points,playheadTime,totalTime',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/08/01/adding-actionscript-cue-points-using-the-cuepointmanager/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

