# Problem accessing Array

**URL:** <https://forum.kirupa.com/t/problem-accessing-array/97871>\
**Category:** Uncategorized\
**Created:** [December 30, 2003, 2:45pm UTC](https://forum.kirupa.com/t/problem-accessing-array/97871 "2003-12-30T14:45:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lira](https://avatars.discourse-cdn.com/v4/letter/l/8e8cbc/32.png) [@lira](https://forum.kirupa.com/u/lira)\
**Post date:** [December 30, 2003, 2:45pm UTC](https://forum.kirupa.com/t/problem-accessing-array/97871/1 "2003-12-30T14:45:57Z")

</div>

Hi, I’ve done the following

[AS]  
playList\_lv = new LoadVars();  
playList\_lv.load(“playlist.txt”);  
playList\_lv.onLoad = function(){  
\_root.playList1 = this.playlist.split(";");

}  
trace(\_root.playList1);

[/AS]

and for playlist.txt:  
playlist=a;b;c

trace returns undefined.  
but when i place trace inside the onload function,…

[AS]  
playList\_lv = new LoadVars();  
playList\_lv.load(“playlist.txt”);  
playList\_lv.onLoad = function(){  
\_root.playList1 = this.playlist.split(";");  
trace(\_root.playList1);  
}

[/AS]

trace gives me a,b,c. am i missing out something? i cant seem to access the array from outside onLoad() …
