Welcome, Guest
  • Author Topic: Problem with scroll pane component  (Read 2085 times)

    ..:: Mazhar Hasan ::..

    • Moderator
    • Systems Administrator
    • *****
    • Posts: 828
    • Cheers
      • View Profile
      • SyedMazharHasan.com
    Problem with scroll pane component
    « on: 12/04/04, 18:15 »
    Hi there! I m seriously stuck in a problem that i have a scroll pane component on my stage named pane & it loads its content from a mc whose linkage identifier is clip, in that mc, i have a MC  in which i wanna show posts of my blog, the problem is if i duplicate the information movie clip without loading data in to that then it works fine & scrollpane show its vertical scroll bar as it should, but if i duplicate the same clip with same code after loading data & assigning to it then although the data is loading succesfully, the MC are being duplicated truely, the data is appearing in them nicely as it should but the scroll pane component is not showing its vertical scrollbar even when it is due.Note: if have tried the vScrollPolicy property & tried both auto & on as the value but still no success :(((


    here is the code without loading data:
    Code: [Select]


    this.clipToDuplicate._visible = 0; //first i m making the original clip invisible to avoid any overlapping
    ypos = 18;//the initial y axis value of first duplicated clip
       for (i=0; i<len; i++) {
          duplicateMovieClip("clipToDuplicate","clip"+i,i);//duplicating the movie clip
          clip = eval("clip"+i);
          setProperty("clip",_y,ypos);//setting the y-axis value of duplicated clip
          ypos += 130;//increamenting in the value of y-axis according to hight of clip
       }



    the above on works fine & scrollpane shows the scroll bars,
    & here is the same code after loading data & assigning to clips:
    Code: [Select]


    this.clipToDuplicate._visible = 0;
    ypos = 18;
    var artXml:XML = new XML();
    artXml.ignoreWhite = true;
    artXml.load("http://localhost:95/data/top10.asp");
    artXml.onLoad = function() {
       len = artXml.firstChild.childNodes.length;//getting no. of posts
       var node:XMLNode = new XMLNode();
       node = artXml.firstChild;
       for (i=0; i<len; i++) {
          duplicateMovieClip("clipToDuplicate","clip"+i,i);
          clip = eval("clip"+i);
          setProperty("clip",_y,ypos);
          catID = node.childNodes[i].firstChild.attributes.value;
          catName = node.childNodes[i].firstChild.nextSibling.attributes.value;
          artID = node.childNodes[i].firstChild.nextSibling.nextSibling.attributes.value;
          artTitle = node.childNodes[i].firstChild.nextSibling.nextSibling.nextSibling.attributes.value;
          artDescription = node.childNodes[i].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.attributes.value;
          artDate = node.childNodes[i].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.attributes.value;
          clip.catagory.text = catName;
          clip.heading.text = artTitle;
          clip.description.text = artDescription;
          clip.dat.text = artDate;
          clip.invClip.artID = artID;
          clip.invClip.catID = catID;
          ypos += 130;
       }
    };





    the above code does every thing fine but with this code, my scrollpane sucks as it doesnot shows its vertical scroll bar inspite of trying vScrollPolicy = "on" or"auto" both & the use of pane.refreshPane() also produces no results.


    please help me out & bring me out of this hell.
    Your wish is my command

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re:Problem with scroll pane component
    « Reply #1 on: 12/06/04, 05:24 »
    Use vScrollPolicy = "on" when you finish to load the data ad duplicate movies, not before.

    Jorge

    ..:: Mazhar Hasan ::..

    • Moderator
    • Systems Administrator
    • *****
    • Posts: 828
    • Cheers
      • View Profile
      • SyedMazharHasan.com
    Re:Problem with scroll pane component
    « Reply #2 on: 12/06/04, 15:56 »
    Since i m using the onLoad property of XML & duplicating the MCs in the function which invokes after the onLoad event is triggers like:

    xml.onLoad =function(){
    //script for duplicating clips

    }


    it means the data has been loaded.


    now what should i do?? should i apply the onData trigger or the properties getBytesLoaded...
    Your wish is my command

    ..:: Mazhar Hasan ::..

    • Moderator
    • Systems Administrator
    • *****
    • Posts: 828
    • Cheers
      • View Profile
      • SyedMazharHasan.com
    Re:Problem with scroll pane component
    « Reply #3 on: 12/06/04, 17:36 »
    Hey jorge i done it with your help ;) I put the vScrollPlicy = "on" right after the end of for loop(means after loading all the clips & assigning the data to them) & it worked
    Your wish is my command