# Scope Issue in As1.0

**URL:** <https://forum.kirupa.com/t/scope-issue-in-as1-0/190169>\
**Category:** flash\
**Created:** [June 9, 2006, 6:02am UTC](https://forum.kirupa.com/t/scope-issue-in-as1-0/190169 "2006-06-09T06:02:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandeep\_cdac200](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@sandeep\_cdac200](https://forum.kirupa.com/u/sandeep_cdac200)\
**Post date:** [June 9, 2006, 6:02am UTC](https://forum.kirupa.com/t/scope-issue-in-as1-0/190169/1 "2006-06-09T06:02:47Z")

</div>

hi all

i am just writting this test code in AS1.0. Now the problem here for me is am not able to get access to my class variables.I m doing this stuff for learning As1.0. Although in 2.0 i get through those using static variable(trick i got from macromedia forums 😉 ). bt in As1.0 i dnt hw to do this.

here is my code:

```auto
function main()
{
    this._xml=new XML();
    this._arImages=[];
    this._xml.ignoreWhite=true;    
    this._xml.onLoad=this.LoadData;
}
main.prototype.showImage=function()
{
    trace("Great! that function calls me");
}
main.prototype.LoadData=function(ok)
{
    if(ok)
    {
        var L1=this.firstChild.childNodes.length
        trace("Scope="+this.Data["a"]);
        for(var i=0;i<L1;i++)
        {
            
            trace("Data="+this.firstChild.childNodes*.firstChild.nodeValue);
            //i wanna put this data into my _arImages data\\
        }
    }
    //here i wanna call sm other class function
    //this.showImage()
    //trace("Here Scope="+this);//refers to xml not to my class
}
main.prototype.LoadXML=function(a)
{
    this._xml.load(a);
}
var getData=new main();
getData.LoadXML("a.xml");

```

The XML Structure is :

```auto
<data>
    <images>a.jpg</images>
</data>

```

Thanks for any help!
