A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Hyperlinks in XML

  1. #1
    Junior Member
    Join Date
    Jun 2006
    Posts
    4

    Hyperlinks in XML

    Hello everybody!

    I'm new in the forum but have been visiting Flashkit for quite a while now. I have a question. I created a Flash ad that calls pictures and text from an external XML file. Everything works fine, but I want to take it up a notch and turn the text into a hyperlink in the XML. This is what I have so far in the XML file:

    <gallery>
    <image title="Dragon's Den" main="images/1.jpg" thmb="thumbnails/1.jpg"/>
    <image title="White Water Run" main="images/2.jpg" thmb="thumbnails/2.jpg"/>
    </gallery>

    I would like to turn the "Dragon's Den" and the "White Water Run" into separate hyperlinks.

    Can anyone help me?

    Thank you!

  2. #2
    Junior Member
    Join Date
    Jun 2006
    Posts
    4

    Continue

    Maybe this will help as well.

    Here's the actionscript used in the Flash file:

    myPhoto = new XML();
    myPhoto.ignoreWhite = true;
    myPhoto.onLoad = function(success) {
    //portfolioTag = this.firstChild;
    numimages = this.firstChild.childNodes.length;
    spacing = 72;
    for (i=0; i<numimages; i++) {
    this.picHolder = this.firstChild.childNodes[i];
    this.thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
    this.thumbHolder._x = i*spacing;
    this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_i mage", 0);
    this.thumbLoader.loadMovie(this.picHolder.attribut es.thmb);
    this.thumbHolder.title = this.picHolder.attributes.title;
    this.thumbHolder.main = this.picHolder.attributes.main;

    this.thumbHolder.onRelease = function() {
    loader.loadMovie(this.main);
    title_txt.text = this.title;
    };
    }
    };

    myPhoto.load("xmlphoto.xml");



    Thank you!

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