salve ho trovato qst script
come posso modificare qst script in modo che ricarichi il file ogni 5 minutiCodice PHP://-------------------------------------------------------------------------
// XML
//-------------------------------------------------------------------------
var xmlLoader:URLLoader = new URLLoader();
var xmlRequest:URLRequest = new URLRequest("news.xml");
xmlLoader.addEventListener(Event.COMPLETE, Load_XML);
xmlLoader.load(xmlRequest);
var news_title:Array = new Array();
var news_description:Array = new Array();
var text_to_scroll = "";
var i:int;
var num = 0;
/* var title_tag_op:String = "<font color='#66CC00'>"; var title_tag_cl:String = "</font>"; */ function Load_XML(e:Event) {
var xml:XML = new XML(e.target.data);
// ..
for each (var item_1:String in (xml.title.*) ) {
news_title.push(item_1); }
// ..
for each (var item_2:String in (xml.description.*) ) {
news_description.push(item_2);
}
// ..
for (i = 0; i <= (news_title.length-1); i++) {
text_to_scroll += "[b]" + news_title[i] + "[/b]" + " " + news_description[i] + " ";
}
// ..
load_news();
// ..
}
function load_news():void{
//SCROLLING SPEED
var scrolling_speed:int = 5;
//establish the field
var my_text:TextField = new TextField();
//add the field to stage
addChild(my_text);
setChildIndex(my_text,1);
setChildIndex(sf_ora,2);
setChildIndex(oramin,3);
//set the text
my_text.htmlText = text_to_scroll;
//set the x coord off right side of stage
my_text.x = stage.stageWidth;
//set y coord in middle of stage (about)
//my_text.y = (stage.stageHeight/2)-(my_text.height/2);
my_text.y = 520;
//not selectable
my_text.selectable = false;
//no border
my_text.border = false;
//field scales with more text
my_text.autoSize = TextFieldAutoSize.LEFT;
//set a format
var my_text_format:TextFormat = new TextFormat();
my_text_format.font = "Arial";
my_text_format.color = 0x000000;
my_text_format.size = 40;
//apply formatting
my_text.setTextFormat(my_text_format);
//add the listener to scroll my_text.addEventListener(Event.ENTER_FRAME,move_text);
//scroll function
function move_text(myevent:Event):void {
my_text.x-=scrolling_speed;
if(my_text.x<(0-my_text.width)){
my_text.x=stage.stageWidth;
num++; }
}
}
grazie

Rispondi quotando