home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 136 / MOBICLIC136.ISO / pc / DATA / EPP136 / EPP136_00 / EPP136_00.swf / scripts / DefineSprite_72 / frame_6 / DoAction.as
Text File  |  2011-07-20  |  1KB  |  51 lines

  1. function checkTime()
  2. {
  3.    var _loc1_ = stream_ns.time * 100 / gDuration;
  4.    gClipGen.TIMELINE.gotoAndStop(Math.floor(_loc1_ * 10));
  5. }
  6. var connection_nc = new NetConnection();
  7. connection_nc.connect(null);
  8. var stream_ns = new NetStream(connection_nc);
  9. stream_ns.setBufferTime(3);
  10. videoBox.my_video.attachVideo(stream_ns);
  11. myVideoPath = videoPath;
  12. trace("myVideoPath = " + myVideoPath);
  13. stream_ns.onMetaData = function(infoObject)
  14. {
  15.    for(var _loc2_ in infoObject)
  16.    {
  17.       if(_loc2_ == "duration")
  18.       {
  19.          gDuration = infoObject[_loc2_];
  20.       }
  21.    }
  22. };
  23. var time_interval = setInterval(checkTime,50,stream_ns);
  24. trace("gClipGen.gClic.pNum = " + gClipGen.gClic.pNum);
  25. if(gClipGen.gClic.pNum == "02")
  26. {
  27.    fond.useHandCursor = false;
  28.    fond.onPress = function()
  29.    {
  30.       stream_ns.close();
  31.       gClipGen.TIMELINE.gotoAndStop(1);
  32.       gClipGen.finVideo();
  33.    };
  34. }
  35. else
  36. {
  37.    delete fond.onPress;
  38. }
  39. stream_ns.play(myVideoPath);
  40. stream_ns.onStatus = function(infoObject)
  41. {
  42.    for(var _loc2_ in infoObject)
  43.    {
  44.       if(infoObject[_loc2_] == "NetStream.Play.Stop")
  45.       {
  46.          gClipGen.TIMELINE.gotoAndStop(1000);
  47.          gClipGen.finVideo();
  48.       }
  49.    }
  50. };
  51.