Difference between revisions of "Logo.as"
(Changing from Yi-msg to RC-Summary.php output) |
(Updating with new tested code) |
||
| Line 1: | Line 1: | ||
| + | // Misc logic | ||
| + | id0 = 0; | ||
| + | changes = []; | ||
| + | change = false; | ||
| + | nchanges = 10; | ||
| + | offset = 0; | ||
| + | |||
// Set up async connection with server | // Set up async connection with server | ||
server = new LoadVars(); | server = new LoadVars(); | ||
| + | server.title = 'RC-Summary'; // wiki page to request | ||
| + | server.SWF = 1; // return raw query-string format | ||
server.onLoad = function(success) { | server.onLoad = function(success) { | ||
| − | if (success) for ( i = 0; i < | + | if (success) { |
| − | + | for ( i = 0; i < nchanges; i++ ) { | |
| + | row = this['item'+i].split(','); | ||
| + | id = row.shift(); | ||
| + | if ( ( i == 0 ) && ( id ne id0 ) ) { id0 = id; offset = -20; } | ||
| + | time = row.shift(); | ||
| + | user = row.shift(); | ||
| + | user = '<a href="/User:'+user+'">'+user+'</a>'; | ||
| + | title = row.shift(); | ||
| + | title = '<a href="/'+title+'">'+title+'</a>'; | ||
| + | comment = row.join(','); | ||
| + | changes[i] = '<font face="arial, helvetica" color="#aaaaaa"><b>'+user+': </b> '; | ||
| + | changes[i] += title+'</font><font face="arial" size="17"> </font><br>'; | ||
| + | } | ||
| + | rc.htmlText = changes.join(''); | ||
} | } | ||
}; | }; | ||
| Line 9: | Line 31: | ||
// Textbox | // Textbox | ||
createTextField( 'rc', 1, 0, 0, 190, 200 ); | createTextField( 'rc', 1, 0, 0, 190, 200 ); | ||
| − | with ( rc ) { | + | with (rc) { |
selectable = false; | selectable = false; | ||
_quality = 'BEST'; | _quality = 'BEST'; | ||
| Line 16: | Line 38: | ||
wordWrap = false; | wordWrap = false; | ||
html = true; | html = true; | ||
| − | |||
} | } | ||
| Line 24: | Line 45: | ||
// Per-frame function | // Per-frame function | ||
function reduce() { | function reduce() { | ||
| − | if ( | + | |
| + | // Scrolling | ||
| + | if ( offset < 0 ) offset++; | ||
| + | rc._y = offset; | ||
| + | |||
| + | // Make request on some regular cycle which seems about right | ||
| + | if ( ++_root.ctr%200 == 1 ) | ||
| + | server.sendAndLoad( 'http://www.organicdesign.co.nz/wiki/index.php', server, 'GET' ); | ||
| + | |||
} | } | ||
Revision as of 07:42, 25 February 2006
// Misc logic id0 = 0; changes = []; change = false; nchanges = 10; offset = 0;
// Set up async connection with server
server = new LoadVars();
server.title = 'RC-Summary'; // wiki page to request
server.SWF = 1; // return raw query-string format
server.onLoad = function(success) {
if (success) {
for ( i = 0; i < nchanges; i++ ) {
row = this['item'+i].split(',');
id = row.shift();
if ( ( i == 0 ) && ( id ne id0 ) ) { id0 = id; offset = -20; }
time = row.shift();
user = row.shift();
user = '<a href="/User:'+user+'">'+user+'</a>';
title = row.shift();
title = '<a href="/'+title+'">'+title+'</a>';
comment = row.join(',');
changes[i] = ''+user+': ';
changes[i] += title+'
';
}
rc.htmlText = changes.join();
}
};
// Textbox createTextField( 'rc', 1, 0, 0, 190, 200 ); with (rc) { selectable = false; _quality = 'BEST'; border = false; multiline = true; wordWrap = false; html = true; }
// Logo attachMovie( 'logo', 'xmlwiki', 2 );
// Per-frame function function reduce() {
// Scrolling if ( offset < 0 ) offset++; rc._y = offset;
// Make request on some regular cycle which seems about right if ( ++_root.ctr%200 == 1 ) server.sendAndLoad( 'http://www.organicdesign.co.nz/wiki/index.php', server, 'GET' );
}



