-
Notifications
You must be signed in to change notification settings - Fork 0
/
hello.mxml
57 lines (41 loc) · 1.48 KB
/
hello.mxml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"
layout="vertical"
creationComplete = "init()" >
<mx:Script>
<![CDATA[
import mx.utils.ObjectUtil;
private var nc:NetConnection;
private var ns:NetStream;
private var video:Video;
private var meta:Object;
public function init():void
{
startVideo();
}
public function startVideo():void {
var nsClient:Object = {};
// nsClient.onMetaData = ns_onMetaData;
nsClient.onCuePoint = ns_onCuePoint;
nc = new NetConnection();
nc.connect(null);
ns = new NetStream(nc);
ns.play("cuepoints.flv");
ns.client = nsClient;
video = new Video();
video.attachNetStream(ns);
uic.addChild(video);
}
private function ns_onCuePoint(infoObject:Object):void {
mainTxt.text += "\nCue: {\n";
var key:String;
for(key in infoObject) {
mainTxt.text += key + ": " + infoObject[key] + "\n";
}
mainTxt.text += "}";
}
]]>
</mx:Script>
<mx:UIComponent id="uic" width="300" height="300" />
<mx:TextArea id = "mainTxt" width="300" height="140" />
</mx:Application>