A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: need help to find good path to images

Hybrid View

  1. #1
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    try pushing your xml nodes into an associative array -
    Code:
    arr = new Array();
    xmlPhotos.onLoad = function() {
    
    for (var i:Number = 0; i<xmlPhotos.firstChild.childNodes.length; i++) {
    var initThumb:Object = new Object();
    initThumb.photo = (xmlPhotos.firstChild.childNodes[i].attributes.photo);
    initThumb.titre = (xmlPhotos.firstChild.childNodes[i].childNodes[0].firstChild);
    initThumb.count = (xmlPhotos.firstChild.childNodes[i].childNodes[1].firstChild);
    arr.push(initThumb);
    }
    use List Variables to show how the array is compiled
    use your counter to loop through the array -
    Code:
    var premierPic:Number = 0;
    
    initThumb.onRelease = function() {
    trace(arr[premierPic].photo);
    mcLargePhoto.loadMovie("images/travel/"+arr[premierPic].photo);
    txtCount.text = this.count;
    txtDesc.text = this.titre;
    mcScroller._alpha = 0;
    };
    untested, but the logic is sound

    EDIT - object moved to inside of loop

  2. #2
    Junior Member
    Join Date
    Sep 2006
    Posts
    22
    well it gives me now a strange output...
    Error opening URL "file:///C|/Documents%20and%20Settings/user/Desktop/SITEFINAL/images/tthumb/undefined"
    strange because this is the path of the makeAThumb function...

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