# Are you up for this

**URL:** <https://forum.kirupa.com/t/are-you-up-for-this/201983>\
**Category:** flash\
**Created:** [September 26, 2006, 7:49pm UTC](https://forum.kirupa.com/t/are-you-up-for-this/201983 "2006-09-26T19:49:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![woyrz](https://avatars.discourse-cdn.com/v4/letter/w/0ea827/32.png) [@woyrz](https://forum.kirupa.com/u/woyrz)\
**Post date:** [September 26, 2006, 7:49pm UTC](https://forum.kirupa.com/t/are-you-up-for-this/201983/1 "2006-09-26T19:49:13Z")

</div>

Hi,  
I’m currently working on a horizontal ticker (finance Ticker).  
My code work juste fine.

My problem is when i active the ticker on my website. The web site just crash. I look with my provider and i tell me that i have to many connection a te same time.

Anyone have a idea?

[AS]  
var formatGreen\_fmt:TextFormat = new TextFormat();  
formatGreen\_fmt.color = 0x51AD3C;  
//style pour ecriture en bleu  
var formatRed\_fmt:TextFormat = new TextFormat();  
formatRed\_fmt.color = 0xE72019;  
//definit la longeur du stage  
var myStageSize:Number = 644;  
//speed du ticker  
var seepOfMe:Number = 2;  
var nameCurrent:String;  
//symbol  
var symbol:String;  
//time  
var time:String;  
//lastPricev  
var lastPrice:String;  
//net change  
var netChange:String;  
// espace entre les different element du movie clip  
var ration:Number = 5;  
//le nom du movie clip qui a ete attribuer  
var nameLast:String;  
//------------Fin variables de base---------  
//----------- DEV -----------------  
\_root.url\_txt.text = this.\_url;  
//----------- / DEV -----------------  
//deplace le movieClip  
function moveMe(nameMe:String) {  
\_root[nameMe].\_x = \_root[nameMe].\_x-seepOfMe;  
if (\_root[nameMe].\_x+\_root[nameMe].\_width\<0) {  
\_root[nameMe].removeMovieClip();  
}  
}  
function doWhileClose() {  
\_root.onEnterFrame = function() {  
var dateMe:Date = new Date();  
heure = dateMe.getHours();  
if (heure\<17 && heure\>=8) {  
loadXML();  
}  
};  
}  
//load les donnees pour les cotes  
function loadXML() {  
var slideTreeXml:XML = new XML();  
slideTreeXml.load(“[http://www.m-x.ca/includes/ticker.php](http://www.m-x.ca/includes/ticker.php)”);  
slideTreeXml.ignoreWhite = true;  
slideTreeXml.onLoad = function(success) {  
trace(“ping”);  
if (success) {  
//generateContent();  
if (slideTreeXml.childNodes[0].attributes.openStatus == 1) {  
for (var z = 0; slideTreeXml.childNodes[0].childNodes[z] != undefined; ++z) {  
nameCurrent = new String(slideTreeXml.childNodes[0].childNodes[z].firstChild.firstChild);  
nameCurrent.toLowerCase();  
//creer un nom qui sera unique pour sur  
nameCurrent = nameCurrent.substr(0, 3)+Math.round((93+z)\*Math.random()\*Math.random()\*2213447434);  
//symbol  
symbol = slideTreeXml.childNodes[0].childNodes[z].childNodes[0].firstChild;  
//time  
time = slideTreeXml.childNodes[0].childNodes[z].childNodes[1].firstChild;  
//lastPricev  
lastPrice = slideTreeXml.childNodes[0].childNodes[z].childNodes[2].firstChild;  
//net change  
netChange = new String(slideTreeXml.childNodes[0].childNodes[z].childNodes[3].firstChild);  
//cree le movie  
\_root.attachMovie(“coteMod\_mc”, nameCurrent, \_root.getNextHighestDepth());  
//si le movie les le premier il vas aller le placer a la Bonne positon  
if (z != 0) {  
\_root[nameCurrent].\_x = \_root[nameLast].\_x+\_root[nameLast].\_width+20;  
} else {  
\_root[nameCurrent].\_x = myStageSize;  
}  
//sassure que les champs soit de bonne dimension  
\_root[nameCurrent].symbol\_txt.autoSize = true;  
\_root[nameCurrent].lastPrice\_txt.autoSize = true;  
\_root[nameCurrent].change\_txt.autoSize = true;  
//defini les field  
\_root[nameCurrent].symbol\_txt.text = symbol;  
\_root[nameCurrent].lastPrice\_txt.text = lastPrice;  
\_root[nameCurrent].change\_txt.text = netChange;  
//cherche a savoir si le changement est negatif ou positif  
if (netChange.substr(0, 1) == “-”) {  
\_root[nameCurrent].arrow\_mc.gotoAndStop(“red”);  
\_root[nameCurrent].change\_txt.setTextFormat(formatRed\_fmt);  
} else {  
\_root[nameCurrent].change\_txt.setTextFormat(formatGreen\_fmt);  
}  
//space out the content  
\_root[nameCurrent].lastPrice\_txt.\_x = \_root[nameCurrent].symbol\_txt.\_width+ration;  
\_root[nameCurrent].arrow\_mc.\_x = \_root[nameCurrent].lastPrice\_txt.\_x+\_root[nameCurrent].lastPrice\_txt.\_width+ration;  
\_root[nameCurrent].change\_txt.\_x = \_root[nameCurrent].arrow\_mc.\_x+\_root[nameCurrent].arrow\_mc.\_width+ration;  
\_root[nameCurrent].doLaunch = true;  
\_root[nameLast].doLaunch = false;  
// var etre utliser pour espacer lautre movie clipe dapres  
nameLast = nameCurrent;  
}  
} else {

```
/*trace(slideTreeXml.childNodes[0].attributes.openStatus);
doWhileClose();*/

```

}  
} else {  
trace(“Can’t load”);  
}  
};  
}  
loadXML();  
[/AS]

Thanks  
Woyrz
