A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: xml based image gallery

  1. #1
    Junior Member
    Join Date
    Oct 2000
    Posts
    7

    xml based image gallery

    Hello Guru's,
    I'm needing some help with getting a hyperlink working from flash that has a XML text load. I tried the standard A Href in the xml, with my flash text field set to render as HTML... to no avail.

    The xml looks like this:
    <?xml version="2.0" encoding="ISO-8859-1" standalone="no"?>
    <images>
    <pic>
    <image>images/imagename.jpg</image>
    <caption>image title</caption>
    </pic>
    </images>

    I tried this:
    <?xml version="2.0" encoding="ISO-8859-1" standalone="no"?>
    <images>
    <pic>
    <image>images/imagename.jpg</image>
    <caption><a href="website";>image title</a></caption>
    </pic>
    </images>


    And it caused the xml beyond that point to be not accessible.

    Any thoughts would be greatly appreciated!
    b.

  2. #2
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Post your .fla so whoever helps can see where you are pushing the captions TOO in your movie since it will affect how they code it.

  3. #3
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,875
    <a href="website";>

    remove the semicolon ... its likely that will cause such a problem... if not upload your fla as Chris suggested.. so we can get a better idea
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  4. #4
    Junior Member
    Join Date
    Oct 2000
    Posts
    7
    here are the source files... Let me know what you think!
    Thanks again!
    b.
    Attached Files Attached Files

  5. #5
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Ok...as delivered I changed three things:

    1. set the textfield to be html enabled (the one in the zip wasn't)

    2. Changed the functions (next,prev) to the correct syntax to populate an html enabled field instead of a standard textfield:

    function nextImage() {
    if (p<(total-1)) {
    p++;
    if (loaded == filesize) {
    picture._alpha = 0;
    picture.loadMovie(image[p], 1);
    //desc_txt.text = description[p];//old way
    desc_txt.htmlText = description[p];
    picture_num();
    }
    }
    }
    function prevImage() {
    if (p>0) {
    p--;
    picture._alpha = 0;
    picture.loadMovie(image[p], 1);
    //desc_txt.text = description[p];//old way
    desc_txt.htmlText = description[p];
    picture_num();
    }
    }


    3. Wrapped the node you are using for html formatted text in a CDATA tag:

    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <images>
    <pic>
    <image>images/image-1.jpg</image>
    <caption>Image Title 1</caption>
    </pic>
    <pic>
    <image>images/image-2.jpg</image>
    <caption>Image Title 2</caption>
    </pic>
    <pic>
    <image>images/image-3.jpg</image>
    <caption><![CDATA[ <a href="www.flashkit.com">Image Title 3</a>]]></caption>
    </pic>

    </images>


  6. #6
    Junior Member
    Join Date
    Oct 2000
    Posts
    7
    that seems to make sense... even to a novice like me. I'll plug this in and let you know!
    Thanks for all your help!
    b.

  7. #7
    Junior Member
    Join Date
    Oct 2000
    Posts
    7
    okay... I loaded the changes you suggested and it's working. Thanks for the assist!

    ps: What do you know about the ComboBox component? after the user chooses a selection from the dropdown, a "ghost" highlight remains behind...

  8. #8

  9. #9
    Junior Member
    Join Date
    Oct 2000
    Posts
    7
    I removed all the graphics to lighten the file size...

    I'm calling the videoBox.swf into the main swf file. That's where the green highlight lingers.... the stand alone videoBox.swf doesn't show it.

    I would show you the live site, but it's a personal site and I don't really want to broadcast my family pics and video. I'll send it to you privately though so you can see what the deal is.

    b.
    Attached Files Attached Files

  10. #10
    Junior Member
    Join Date
    Jul 2007
    Posts
    1

    Target blank url

    Hello there,

    I am trying to get the url to open in a new window using the code above, but have been unsuccessful. I figured I'd put the target="_blank" code within the a href, but still no luck. Can someone please help? The code is below:


    <pic>
    <image>images/5.jpg</image>
    <caption><![CDATA[Text here <ahref="http://www.johnstonanddaniel.com/listings/details.aspx?ListingId=2000570" target="_blank">More Details ></a>]]></caption>
    <link>http://www.yahoo.com</link>
    </pic>

    Thanks in advance...

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