A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 28

Thread: thumbnails only with xml and flash

  1. #1
    Senior Member
    Join Date
    Aug 2007
    Posts
    100

    thumbnails only with xml and flash

    I want load in thumbnails from an xml file to flash to a movieclip called thumb_mc - which duplicates depending on how many pictures are declared in the xml file - but I have no idea how to go about it. I have attached a picture of the concept.
    Attached Images Attached Images

  2. #2
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    hi chrissy. do you know how to create the xml file?
    If you don't think you're going to like the answer, then don't ask the question.

  3. #3
    Senior Member
    Join Date
    Aug 2007
    Posts
    100

    Xml

    Yes I have an xml file

    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <images>
    <pic>
    <image>images/imagename.jpg</image>
    <caption>caption</caption>
    </pic>
    <pic>
    <image>images/imagename.jpg</image>
    <caption>caption</caption>
    </pic>
    <pic>
    <image>images/imagename.jpg</image>
    <caption>caption</caption>
    </pic>
    <pic>
    <image>images/imagename.jpg</image>
    <caption>caption</caption>
    </pic>
    <pic>
    <image>images/imagename.jpg</image>
    <caption>caption</caption>
    </pic>
    <pic>
    <image>images/imagename.jpg</image>
    <caption>caption</caption>
    </pic>
    <pic>
    <image>images/imagename.jpg</image>
    <caption>caption</caption>
    </pic>
    <pic>
    <image>images/imagename.jpg</image>
    <caption>caption</caption>
    </pic>
    <pic>
    <image>images/imagename.jpg</image>
    <caption>caption</caption>
    </pic>
    <pic>
    <image>images/imagename.jpg</image>
    <caption>caption</caption>
    </pic>
    </images>

    What I am aiming for is one movieclip in flash to duplicate depending on how many images are declared in xml and display them like a grid. But I have no idea how to do this.

  4. #4
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    according to your xml, you have 10 thumbs. how do want the grid to look? it can be 2 rows of 5 thumbs, or 2 columns of 5 thumbs.
    If you don't think you're going to like the answer, then don't ask the question.

  5. #5
    Senior Member
    Join Date
    Aug 2007
    Posts
    100
    Quote Originally Posted by EQFlash
    according to your xml, you have 10 thumbs. how do want the grid to look? it can be 2 rows of 5 thumbs, or 2 columns of 5 thumbs.
    I am going for a 2 rows of 5 thumbs.

  6. #6
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    gotcha will have a sample for ya in a bit. do you want the thumbs to be clickable?
    If you don't think you're going to like the answer, then don't ask the question.

  7. #7
    Senior Member
    Join Date
    Aug 2007
    Posts
    100
    Quote Originally Posted by EQFlash
    gotcha will have a sample for ya in a bit. do you want the thumbs to be clickable?
    Yes, I have another MC that I would like to link a bigger picture of the thumbnail or like a paypal add to cart link.

  8. #8
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    where do you want the caption textfields to be?
    If you don't think you're going to like the answer, then don't ask the question.

  9. #9
    Senior Member
    Join Date
    Aug 2007
    Posts
    100

    caption

    I have a dynamic textfield called title_mc

  10. #10
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    ok where would you want them to be? is it one text field? or as many as there are thumbs?
    If you don't think you're going to like the answer, then don't ask the question.

  11. #11
    Senior Member
    Join Date
    Aug 2007
    Posts
    100
    As many as there are thumbs

  12. #12
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    ok. i have a sample for you to check out and let me know. will post in next thread.
    If you don't think you're going to like the answer, then don't ask the question.

  13. #13
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    here is the zip file. you will have to change the xml file to match yours, as long as <pic> remains, because the fla calls it.
    Last edited by EQFlash; 08-04-2008 at 07:08 PM.
    If you don't think you're going to like the answer, then don't ask the question.

  14. #14
    Junior Member
    Join Date
    Jan 2002
    Posts
    4

    Me too

    Hi there...I'm looking for the same functionality. Can you share the solution you came up with? Thanks.

  15. #15
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    here is the same zip i gave to chrissy Again you also will have to change th xml file to match you contents, as long as <pic> stays because the fla calls for it.
    Attached Files Attached Files
    If you don't think you're going to like the answer, then don't ask the question.

  16. #16
    Junior Member
    Join Date
    Jan 2002
    Posts
    4

    Thanks!

    Thanks a bunch...any idea how I get the captions to load without having to click the thumbnails? I'm basically creating a Flash catalog and I'd like each caption to load automatically under each corresponding thumbnail.

  17. #17
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    you want the captions under the thumbnail?
    If you don't think you're going to like the answer, then don't ask the question.

  18. #18
    Junior Member
    Join Date
    Jan 2002
    Posts
    4
    Yes, I'm looking to put the captions under the thumbnails. I would just create a bunch of thumbnails with captions embedded in the .jpgs, but I'd like the caption text to be able to scale well along with the Flash movie (this is for a full screen CD-ROM project). Thanks again for the help!

  19. #19
    Senior Member
    Join Date
    Aug 2007
    Posts
    100

    More coding

    Quote Originally Posted by EQFlash
    you want the captions under the thumbnail?
    The zip file that you sent is great but I have put 10 images with captions in the xml but only 5 captions work. Also I would like to add and add to cart function to the current code but I would like the paypalObj.item_name to read in the caption according to the thumb that is clicked???? Here is the code:

    myThumbs.onRelease = function() {
    var paypalObj = new Object();
    paypalObj['add'] = 1;
    paypalObj.cmd = '_cart';
    paypalObj.business = 'myemailaddress@me.com';
    paypalObj.item_name = ????;
    paypalObj.item_number = '';
    paypalObj.amount = '0.00';
    paypalObj.no_shipping = '0';
    paypalObj.shipping = '';
    paypalObj.tax = '';
    paypalOBJ.undefined_quantity = '1';
    paypalObj.no_note = '1';
    paypalObj.currency_code = 'GBP';
    paypalObj.lc = 'GB';
    paypalObj.bn = 'PP-ShopCartBF';
    paypalObj.target_winName = 'paypal';
    paypalObj.shopping_url = ('http://mycompany.com);
    var sUrl = 'https://www.paypal.com/cgi-bin/webscr?';
    for (var o in paypalObj) {
    sUrl += o+'='+paypalObj[o]+'&';
    }
    trace(sUrl);
    getURL(sUrl, 'paypal', "POST");
    };
    }

  20. #20
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    Hi to both of you. got to go take care of some medical issues today. I will probably be able to get back to you 2morrow. sorry for the delay.
    Last edited by EQFlash; 08-10-2008 at 08:41 AM.
    If you don't think you're going to like the answer, then don't ask the question.

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