A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: XML generated links

  1. #1
    Senior Member
    Join Date
    Sep 2000
    Posts
    184

    XML generated links

    Hi...I am looking to an xml file to generate a simple text link in my movie that will load flv's. I don't want to load the links into a component. I just need simple link text buttons that change color on rollover and act like normal link buttons. Right now it loads into a list box and I don't like the default rollover stuff that can't be changed with setstlye. Most notable the box that appears and highlights around the rollover choice. Can anyone direct me in the right area toward a tut or something? Not much help on searches.

    Thanks

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176

    CDATA section and TextField hitTest

    hope this method is of some help
    PHP Code:
    // extend the TextField class to include the hitTest method
    TextField.prototype.hitTest = hitTest;

    // create the textfield
    this.createTextField("link1",1,100,100,200,30);
    link1.html = true;
    link1.autoSize = true;

    // activate color changes on hitTest
    this.onMouseMove = function(){
    if(link1.hitTest(_xmouse,_ymouse)){
    link1.textColor = 0x0000FF;
    } else {
    link1.textColor = 0xFF0000;
    }
    };

    // load the xml
    _xml = new XML();
    _xml.ignoreWhite = true;
    _xml.load("link.xml");

    // pass the node value to the textfield
    _xml.onLoad = function(){
    link1.htmlText = this.firstChild.firstChild.nodeValue;
    };

    // run this function to load the passed parameter
    function myFunc(param){
    trace(param);
    // code to load flv
    };

    /*--link.xml--

    <?xml version="1.0" encoding="UTF-8"?>
    <node>
    <![CDATA[<P ALIGN='CENTER'><B><FONT color='#FF0000'><a href='asfunction:myFunc,rocket.flv'>RED ROCKET</a></FONT></P>]]>
    </node>

    */

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