<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
                xmlns:pv3d="net.borishorn.pv3d.*" 
                backgroundGradientColors="[0xffffff,0x000000]" backgroundColor="0x000000" 
                verticalScrollPolicy="off" horizontalScrollPolicy="off"
                layout="absolute" addedToStage="setVideoInits()"  viewSourceURL="srcview/index.html"> 
                
                <mx:Script>
                    <![CDATA[
                        import mx.events.VideoEvent;
                    
                    import flash.display.BlendMode;
                    
                    [Bindable]
                    private var _videoWidth:Number;
                    
                    [Bindable]
                    private var _videoHeight:Number;
                    
                    private function setVideoInits():void
                    {
                        _videoWidth = stage.stageWidth;
                        _videoHeight = stage.stageHeight;
                        
                        addEventListener(Event.RESIZE, resizeApp);
                        
                    }
                    
                    private function resizeApp(e:Event):void
                    {
                        
                        _videoWidth = stage.stageWidth;
                        _videoHeight = stage.stageHeight;
                        
                        
                    }
                        
                        private function startVideo():void
                        {
                            video.play();
                            video.scaleX = 1.5;
                            video.scaleY = 1.5;
                            video.blendMode = BlendMode.MULTIPLY;
                            
                            video.addEventListener(VideoEvent.COMPLETE, playVideo);
                            
                            
                            
                        }
                        
                        private function playVideo(e:VideoEvent):void
                        {
                            trace("Video gestartet");
                            video.play();
                            
                        }
                        
                    ]]>
                </mx:Script>
                
    <mx:VideoDisplay id="video" 
            x="-350" y="-200"  
            width="{_videoWidth}" height="{_videoHeight}"
            alpha="0.9" 
              source="assets/video/street.flv" creationComplete="startVideo()"  />
    
    <pv3d:PaperCube id="papercube"/>
        

</mx:Application>