title: How to loop a video on flash for air ?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/9964618/flash-air-video-help-needed">Flash Air video help needed</a>  </p>
  </blockquote>
  
  
  
  <p>I am making a video based application.In this application a 720p is need to be play loop wise.I have 5 Sec video that should play automatically after 5 Sec i mean loop.I am making this application for Android and IOS.I had tried the looping thing use timer of 5 sec but there is a jerk after each clip.I need a smoothly looping without any jerk after the clip</p>
  
  <p>Thanks in Advance </p>
  
  <p>The following is the i am using.If you know any other code better than this please share else please help me with this code</p>
  
  <pre><code>import flash.display.StageScaleMode;
  import flash.display.StageAlign;
  import flash.display.Sprite;
  
  import flash.media.Video;
  
  import flash.net.NetConnection;
  import flash.net.NetStream;
  
  import flash.events.NetStatusEvent;
  import flash.events.MouseEvent;   
  import flash.display.MovieClip;
  
  var video:Video;
  var streamClient:Object;
  var connection:NetConnection;
  var stream:NetStream; 
  
  streamClient = new Object;
  streamClient.onTextData = onTextData;
  streamClient.onMetaData = onMetaData;
  streamClient.onCuePoint = onCuePoint;
  
  video = new Video();
  video.smoothing = true;
  addChild(video); 
  
  clickMe.addEventListener(MouseEvent.CLICK, initiatePlayback);
  
  function initiatePlayback(e:MouseEvent):void
  {
  connection = new NetConnection ;
      connection.client = streamClient;
  connection.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
  connection.connect(null);
  
  myTimer.start();
  video.width = 768;
  video.height = 1024;
  }
  
  function onNetStatus(e:NetStatusEvent):void {
          switch (e.info.code){
              case "NetConnection.Connect.Success":
                 connectStream();
                 break;
              case "NetSream.Buffer.FULL":
                 video.width = 768;
                 video.height = 1024;
                 video.scaleY = video.scaleX;
  
                 break;
          }
      }
  
    function connectStream():void {
          stream = new NetStream(connection);
          stream.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
          stream.client = streamClient;
  
          video.attachNetStream(stream);
          stream.play("movie1.mp4");
      }
      function onTextData(info:Object):void {}
      function onMetaData(info:Object):void {}
      function onCuePoint(info:Object):void {}
  </code></pre>