Quick question regarding accessing variables.

I have the following code

public function tracePath():void {
           
            for (var i:int = 0; i < photoFeed.menu.submenu.length(); i++) {
            trace([EMAIL PROTECTED])
            var results:XMLList = 
[EMAIL PROTECTED];
            trace(results);
               trace (i);
            var myUIComponent:UIComponent = new UIComponent();
           
            myUIComponent.graphics.beginFill(0xFFCC00);
            myUIComponent.graphics.drawCircle(60*i, 30, 30);
            myUIComponent.buttonMode = true;
            myUIComponent.useHandCursor = true;
            myUIComponent.addEventListener(MouseEvent.CLICK, 
mouseClickHandler);
           
            this.addChild(myUIComponent);
              
            }
            trace(photoFeed.menu.submenu.length() +"hello");
        }

and I access using this function
public function mouseClickHandler(event:MouseEvent):void{
        trace(this.i);
        }

My question is... how do I access the "i" variable from within the 
mouseClickHandler() function
so I could find out certain properties. The above code does not seem to 
find the "i" based on the dynamically created component.

I really want to be able to find out the list collection based on click.

Thanks
Jeremy

Reply via email to