The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 1 of 1

Thread: Help on News Ticker

  1. #1

    Afrostyle Help on News Ticker

    Hi Everyone!

    I just want to know if somebody can help I was doing the news ticker tutorial in my site but the problem is it only show one item on my xml file, im using the file http://www.kirupa.com/modular/kirupa.xml

    not the one that was in the exact tutorials, can anybody here knows what should i change in my actionscript below:


    function loadXML(loaded)
    {
    if (loaded)
    { xmlNode = this.firstChild;
    caption = [];
    desc = [];
    url = [];
    total = xmlNode.childNodes.length;
    for (i=0; i<total; i++)
    {
    caption[i] = xmlNode.childNodes[i].childNodes [0].firstChild.nodeValue;
    desc[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
    url[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
    }
    first_item();
    } else
    { content = "file not loaded!"; }
    }
    xmlData = new XML();
    xmlData.ignoreWhite = true; xmlData.onLoad = loadXML; xmlData.load("http://www.kirupa.com/modular/kirupa.xml?blarg="+new Date().getTime());
    // function first_item()
    {
    delay = 1000;
    p = 0;
    display(p); p++;
    }
    function timer()
    {
    myInterval = setInterval(ticker, delay);
    function ticker()
    {
    clearInterval(myInterval);
    if (p == total)
    {
    p = 0;
    }
    fadeout();
    }
    }
    function display(pos)
    {
    over = new TextFormat();
    over.underline = true;
    //
    out = new TextFormat();
    out.underline = false;
    //
    newsMC.newsText._alpha = 100;
    newsMC.newsText.text = caption[pos]+"\n"+desc[pos]; newsMC.onRelease = function()
    { getURL(url[pos], "_self"); }; newsMC.onRollOver = function() { this.newsText.setTextFormat(over); }; newsMC.onRollOut = function() { this.newsText.setTextFormat(out); }; timer(); } function fadeout() { this.onEnterFrame = function() { if (newsMC.newsText._alpha>=0) { newsMC.newsText._alpha -= 5; } else { display(p); p++; delete this.onEnterFrame; } }; }

    so that it show all the items in the xml file.

    Thanks in advance,
    mjmdotorg
    Last edited by mjmdotorg; January 24th, 2007 at 02:46 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012