var counter = new LoadVars(); var act:Number = 0; var max:Number; showcontent(0); counter.onLoad=function(){ max = counter.var1; } counter.load('engine/guestbooknum.php'); if(act >= 5) prev_btn._alpha = 100; if(max > 5 && act < max) next_btn._alpha = 100; var styles:TextField.StyleSheet = new TextField.StyleSheet(); styles.setStyle("title", { color:'#8E240B', marginLeft:'10', fontWeight:'bold', fontSize:'14', display:'block' }); styles.setStyle("content", { color:'#cccccc', fontFamily:'Verdana', fontSize:'11', textIndent:'5' }); styles.setStyle("a", { color:'#8E240B' }); styles.setStyle("a:hover", { color:'#F28484' }); function showcontent(act:Number) { var my_xml = new XML(); my_xml.ignoreWhite = true; my_xml.onLoad = function(success) { if(success){ trace(this.toString()); cContent.styleSheet = styles; cContent.text = this; } else { trace('fatality'); cContent.text = 'database error - try again'; } } my_xml.load('engine/guestbooksender.php?id='+act+'&ck='+Math.random()); } next_btn.onRelease = function() { if(act < max-5) { act+=5; showcontent(act); if(act >= 5) prev_btn._alpha = 100; if(max > 5 && act < max) next_btn._alpha = 100; } } prev_btn.onRelease = function() { if(act > 0) { act-=5; showcontent(act); if(max > 5 && act < max) next_btn._alpha = 100; if(act >= 5) prev_btn._alpha = 100; } } dodaj_wpis.onRelease = function() { _parent.loadChapter(10); } scroll_up.onRollOver = function() { sc = setInterval(scrolling, 50, -1); scroll_up._alpha = 100; } scroll_up.onRollOut = function() { clearInterval(sc); scroll_up._alpha = 70; } scroll_down.onRollOver = function() { sc = setInterval(scrolling, 50, 1); scroll_down._alpha = 100; } scroll_down.onRollOut = function() { clearInterval(sc); scroll_down._alpha = 70; } function scrolling(val) { if (val>0){ if(cContent.scroll0) { cContent.scroll--; } } } stop();