11 Replies Latest reply on Dec 29, 2010 5:34 PM by JeffLKS

    Getting a video player to play inside a site

    auto_ghost

      I have a site I've added a few new modules to, but the video player module just doesn't want to play at all!

      All the components load when I test the movie but none of the external data loads, and when I test the scene with all components on its own it works fine...

       

      I've tried a few things but, still can't get this to work, and I've even tried downloading another multi video player and it did the same thing, I don't know where I'm going wrong!

       

      It's all contained in a movieclip called 'bsv' and as I said works fine when I do test scene

       

      Can anybody help? or be able to take a look at the site if I were to upload it?

       

      Here's the actionscript 2 that goes with it:

       

      /**********---------- Config Part ----------**********/

      import cn.com.webstudio.util.*;

      Stage.scaleMode = "noscale";

      Stage.align = "TL";

      //Stage.showMenu = false;

      stop();

      /**********---------- Variable Part ----------**********/

      var xmlpath:String;

      var dataArr:Array = [];

      var curItem:Number = 0;

      //sound volume setting

      var volume:Number = 50;

      //buffer time setting

      var bufferTime:Number = 10;

      var locked:Boolean = false;

      //please set these fellowing value from external xml file.

      var autoPlayFirst:Boolean = false;

      var autoPlayAll:Boolean = false;

      var autoNext:Boolean = false;

      var mainStyleColor:Number = FFFFFF;

      //

      var titleItem, videoItem, thumbList, controlItem, scrollItem;

      /**********---------- Function Part ----------**********/

      // Load the xml file.

      function loadXML(url:String, callback:Function) {

      var myxml:XML = new XML();

      myxml.ignoreWhite = true;

      myxml.onLoad = function(success) {

      if (success) {

      if (callback != null) {

      callback(this);

      }

      }

      };

      myxml.load(url);

      }

      if(xmlpath !== undefined ){

      loadXML(xmlpath, parseXML);

      }else{

      loadXML("xml/config.xml",parseXML);

      }

      // parse xml data

      function parseXML(xml:XML) {

      curItem = -1;

      dataArr = [];

      var i, j, temp1, temp2, temp3;

      temp1 = xml.firstChild.firstChild.childNodes;

       

      // config part

      autoPlayFirst = temp1[0].firstChild.nodeValue=="true";

      autoPlayAll = temp1[1].firstChild.nodeValue=="true";

      autoNext = temp1[2].firstChild.nodeValue=="true";

      mainStyleColor = int(temp1[3].firstChild.nodeValue);

       

      // item data

      temp2 = xml.firstChild.childNodes[1].childNodes;

      for (i in temp2) {

      dataArr[i] = {};

      temp3 = temp2[i].childNodes;

      for (j in temp3) {

      dataArr[i][temp3[j].nodeName] = temp3[j].firstChild.nodeValue;

      }

      }

      init();

      }

      function init() {

      // title item

      titleItem = this.attachMovie("titleItem", "titleItem", 1);

      titleItem._x = 68;

      titleItem._y = 21;

      // video list

      videoItem = this.attachMovie("videoItem", "videoItem", 2);

      videoItem._x = 68;

      videoItem._y = 50;

      videoItem.posX = videoItem._x;

      videoItem.posY = videoItem._y;

      videoItem.posW = videoItem._width;

      videoItem.posH = videoItem._height;

      // thumb list

      thumbList = this.attachMovie("thumbList", "thumbList", 3);

      thumbList._x = 558;

      thumbList._y = 20;

      // control item

      controlItem = this.attachMovie("controlItem", "controlItem", 4);

      controlItem._x = videoItem._x-1;

      controlItem._y = videoItem._y+videoItem._height+11;

      controlItem.posX = controlItem._x;

      controlItem.posY = controlItem._y;

      var mainStyleColor:Number = FFFFFF;

      //controlItem.volBut.onPress();

       

      // scroll item

      scrollItem = this.attachMovie("scrollItem", "scrollItem", 5);

      scrollItem._x = thumbList._x+thumbList._width-scrollItem._width+3;

      scrollItem._y = thumbList._y+thumbList.mask._y;

      // set main style color

      setStyle();

      }

      function setStyle() {

      wEffect.setRGB(thumbList.back, mainStyleColor);

      wEffect.setRGB(controlItem.back, mainStyleColor);

      wEffect.setRGB(titleItem.back, mainStyleColor);

      }

      Thanks
      Phil