Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

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