# Class and nightmare

**URL:** <https://forum.kirupa.com/t/class-and-nightmare/181497>\
**Category:** flash\
**Created:** [March 9, 2006, 8:50pm UTC](https://forum.kirupa.com/t/class-and-nightmare/181497 "2006-03-09T20:50:11Z")\
**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:** [March 9, 2006, 8:50pm UTC](https://forum.kirupa.com/t/class-and-nightmare/181497/1 "2006-03-09T20:50:11Z")

</div>

I working on a class i i have a hard time calling a function that is inside my class from a other function in the class

Here the code  
[AS]  
class profil {  
public var address:String ;  
/\* initialisation de la class\*/  
public function profil(type:String) {  
}  
/\* mecanique\*/  
public function loadProfil(no\_sercuriteParam:String) {  
no\_sercuriteParam = “9b6db24710fe”;  
var profilXml:XML = new XML();  
address = address+no\_sercuriteParam;  
profilXml.load(address);  
profilXml.ignoreWhite = true;  
profilXml.onLoad = function(success) {  
if (success) {  
var i:Number = 0;  
while (profilXml.childNodes[0].childNodes[0].childNodes\*.nodeName) {  
//trace(profilXml.childNodes[0].childNodes[0].childNodes\*.nodeName+"=\>"+profilXml.childNodes[0].childNodes[0].childNodes\*.firstChild.nodeValue);  
this[profilXml.childNodes[0].childNodes[0].childNodes\*.nodeName] = profilXml.childNodes[0].childNodes[0].childNodes\*.firstChild.nodeValue;  
++i  
}  
fillfields() // \<------------- here is my proble  
//\_root.gotoAndStop(“showProfil”);  
}  
};

}  
public function fillfields() {  
trace(“start”);  
var fieldsAsscFromPhp:Array = new Array(“sexe”, “nom”, “prenom”, “courriel”, “courriel”, “compagnie”, “titre”, “ville”, “province”, “pays”, “age”);  
var fieldsAsscFromFlash:Array = new Array(“salutation\_txt”, “nom\_txt”, “prenom\_txt”, “courriel\_txt”, “confirm\_courr\_txt”, “compagnie\_txt”, “titre\_txt”, “ville\_txt”, “province\_txt”, “pays\_txt”, “age\_txt”);  
// arrete la fonction si le nombre de champs ne corespond pas  
if (fieldsAsscFromPhp.length != fieldsAsscFromFlash.length) {  
return trace("Verifiez les Array ‘fieldsAsscFromPhp’ et ‘fieldsAsscFromFlash’ pour etre sur qu’elles contienne le meme nombres de champs ");  
}

trace(fieldsAsscFromPhp);  
var totalChamps:Number = fieldsAsscFromPhp.length;  
trace(totalChamps);  
for (var i = 0; i\<=totalChamps; ++i) {  
trace(“allo”);  
trace(this[fieldsAsscFromPhp\*]);  
\_root[fieldsAsscFromFlash\*].text = this[fieldsAsscFromPhp\*];  
}  
return true;  
}  
}  
[/AS]

If i call [AS]fillfields([/AS] from insde the [AS]profilXml.onLoad[/AS] it does’nt work but if i put it juste after it work fin but my data are not loaded. I know that the xml is lodding perfectly.

Thanks for your help !!!  
:jail:  
francis  
[http://www](http://www).mediaflexdesign.com
