1 Reply Latest reply on Dec 10, 2010 3:35 PM by auto_ghost

    Video player not working inside a movieclip

    auto_ghost

      Hi,

       

      I'm editing a flash site that needs a multi video player.

      I've already added a few other features to the site, so know the drill now...

      ...but

       

      This video player just doesn't load the external files to it. I'm doing exactly the same thing I did with the other elements, but this doesn't seem to want to work.

      I've triple checked the spelling of 'config.xml' and even tried changing the action script settings to frame 2, which just makes all the preloaders spin around!

       

      Here's the AS (AS2) can anyone help me?

       

      /**********---------- 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("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=="false";      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); }
        • 1. Re: Video player not working inside a movieclip
          auto_ghost Level 1

          /**********---------- 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("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=="false";
              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);
          }