dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Scrollpane in the arse

  1. #1
    Big Goof
    Join Date
    Jun 2003
    Location
    White Rock, BC
    Posts
    20

    Scrollpane in the arse

    Okay. After combing over the many examples of using the scrollpane, I am needing assistance in something I am working on.

    The basic idea;

    I am loading jpg thumbnails form an XML document into a scrollpane.

    Next, I am taking these thumbnails and giving them on Release functionality.

    Finally, I am displaying the large picture after the thumbnail has been clicked.

    Everything works as intended. EXCEPT, the problem is loading the thumbnails into the scrollpane. Here's the code I have so far;

    ----------------------------
    _global.picxml = new XML();
    picxml.ignoreWhite = true;

    picxml.onLoad = function(success)
    {
    if (success) {
    parseXmlDoc(this);
    }
    else trace('xml screw up!');
    };

    picxml.load("pics.xml");

    function parseXmlDoc(xmlDoc)
    {
    if (xmlDoc.loaded)
    {
    var yPos = 60;
    xmlLength = xmlDoc.firstChild.childNodes;


    for( i=0; i < xmlLength.length; i++ )
    {

    xmlThumb = xmlDoc.firstChild.childNodes[i];
    imagePath = xmlThumb.attributes.thumbURL;

    targetClip.duplicateMovieClip(i, i);

    loadMovie(imagePath,[i]);
    this[i]._y = this[i]._y + (i*yPos);

    }
    }
    this.cmpThumbs.setScrollContent(targetClip);
    this.cmpThumbs.refreshPane();
    }

    ------------------------------

    I think the problem can be that the duplicate movie clips are being named; 0, 1, 2, 3, 4, 5, etc. I thought that by setting 'targetClip' to the scroll content would send the duplicate movie clips into the pane, but it does not.

    Any assistance would be appreciated. Thanks.
    Crazy Bat Designs.


  2. #2
    Big Goof
    Join Date
    Jun 2003
    Location
    White Rock, BC
    Posts
    20
    Perhaps I can elaborate a bit (since I wrote this late at night last night.)

    On my stage, I have;

    1. Empty movie clip. Instance; 'targetClip'.
    2. Scrollpane. Instance; 'cmpThumbs'.

    When my movie is created, I am having a look at the objects created;

    Movie Clip: Frame=1 Target="_level0.targetClip"
    Movie Clip: Frame=1 Target="_level0.0"
    Shape:
    Movie Clip: Frame=1 Target="_level0.1"
    Shape:
    Movie Clip: Frame=1 Target="_level0.2"
    Shape:
    Movie Clip: Frame=1 Target="_level0.3"
    Shape:
    Movie Clip: Frame=1 Target="_level0.4"
    Shape:
    Movie Clip: Frame=1 Target="_level0.5"
    Shape:

    (FYI; I created the movies like this for my on Release function to connect to the appropriate child node to get the full size picture)

    So, I thought that when you duplicate a movie, that I could pull in 'targetClip' into the scrollpane. But it's not. I can see my
    thumbnails, but they float above the scrollpane.

    Please...help a fellow flasher out.
    Crazy Bat Designs.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center