Results 1 to 5 of 5

Thread: Flash/XML - PNG files won't work.

  1. #1
    Join Date
    Oct 2008
    Posts
    15
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default Flash/XML - PNG files won't work.

    I used this Flash XML tutorial:
    http://www.gotoandlearn.com/play?id=22

    Works great on jpegs but not on gifs or pngs.

    Any ideas?

    Here is the actionscript:

    PHP Code:
    var x:XML = new XML();
    x.ignoreWhite true;

    var 
    urls:Array = new Array();
    var 
    captions:Array = new Array();
    var 
    whoIsOn:Number;

    x.onLoad = function(success) {
        var 
    photos:Array = this.firstChild.childNodes;
        for(
    i=0;i<photos.length;i++) {
            
    urls.push(photos[i].attributes.url);
            
    captions.push(photos[i].attributes.caption);
        }
        
    holder.loadMovie(urls[0]);
        
    caption.text captions[0];
        
    whoIsOn 0;
    }

    x.load("productsmd.xml");

    previous.onRelease = function() {
        if(
    whoIsOn 0) {
            
    whoIsOn--;
            
    holder.loadMovie(urls[whoIsOn]);
            
    caption.text captions[whoIsOn];
        }
    }

    next.onRelease = function() {
        if(
    whoIsOn urls.length-1) {
            
    whoIsOn++;
            
    holder.loadMovie(urls[whoIsOn]);
            
    caption.text captions[whoIsOn];
        }


  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    What version of Flash are you using?

  3. #3
    Join Date
    Oct 2008
    Posts
    15
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    Cs3 9.0

  4. #4
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Hmm...it should work then.
    Zip up your files and I'll have a look. There is no reason that should be happening.

  5. #5
    Join Date
    Oct 2008
    Posts
    15
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    Medyman thanks for the help, as I zipped them up, I noticed a typo in the xml

    Now I just have to figure out how to have flash scale the images down to fit within th flash stage....

    Thanks again,

    robert

Bookmarks

Posting Permissions

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