[Help] Utilizing multiple RSS feeds

I noticed that the tutorial widget NewDesklets has a drop down menu in the back that lets you choose which feed you want to display, but I can't find anywhere in the code how the widget distinguishes what to display. Any help?

EDIT: I get how the control thing works and everything, but I don't see two different feeds anywhere.

#343353

!XMLTEXT:0[blahblah] will get the first feed

!XMLTEXT:1[blah bla] will get the second feed.. etc etc

Is this what you mean?

#343397

Yes, thank you... I was thinking this, but wasn't too sure :D

#343421

Actually... I still don't get something...

Let's say that on the backside of the widget I want a menu where the user can choose which feed to have displayed. How, in the code, do I use the person's selection for the front side? Are there if statements in XML :P

#343436

you'd have to use jscript or vbscript for that

in jscript you could do this.

Function UpdateFeed(feed) {
if (feed != '') {
UseFeed = feed;
this.ForceXDataFetch();
this.FlipTo(0);
this.ReDraw();
}
}

between the tags in the xml put this:

<script>main.js</script>

and this has to be in the code too:

<xmls>
<xml src="../../unavailable.html" interval="%Interval%" usewintmp="yes" ongetdata="this.ReDraw();"/>
</xmls>

and parameters:

	  <param name="UseFeed" default="http://the.default/feed" save="yes" onupdate=""/>
<param name="Interval" default="default interval" save="yes" onupdate=""/>
</parameters>

and for the feeds you'd have to do something like this: (using a button in this case)

<layer name="Feed1" x="187" y="170" width="55" height="25" src="../../unavailable.html" dsrc="../../unavailable.html" [b]onclick="UpdateFeed(http://url.to/first/feed);"[/b] mousecursor="crDefault" fontstyle="" fontalign="LT" fontaa="No" fullhittest="yes"/>

If you want to use several preset feeds in the script you could use this, the only thing that would change (except the jscript) is onclick="UpdateFeed(http://url.to/first/feed);", it would become onclick="UpdateFeed(1);" or onclick="UpdateFeed(2);"

Function UpdateFeed(feed) {
if (feed == '1') {
UseFeed = http://feed.1/;
}
if (feed == '2') {
UseFeed = http://feed.2/;
}
this.ForceXDataFetch();
this.FlipTo(0);
this.ReDraw();
}

Didn't test this or anything just some code, i'm not a real good scripter so this may have some things wrong, also i'm not sure about the elseif function, it could be just if or else also for the interval parameter used you'd have to use an other piece of jscript, you can check out other desklets for it (RefreshDelay() in RSS Feed is a good example)

#343491

Okay, thanks I understand it now :D

Is there a check box feature for AveScripter?

#343719

you'll have to make that in code yourself too i think, just make a button with a script that updates the button when it's clicked, not too hard.

also the script i gave could be done more simple, just add multiple xml feeds in the xml and use !XMLTXT:%feed%[yada/yada/yada] and update the %feed% var too the feed number, less script needed

#343902

I'm still away from my pc so I can't give you sample codes :(

But there should be some checkbox made samples in the default "skins" that comes with avescripter.

If memory is working right, you can use a "layer" and have the "Down" state true or false. Then have a src or and dsrc.

#344362