# Targeting Objects in AS2 classes

**URL:** <https://forum.kirupa.com/t/targeting-objects-in-as2-classes/78722>\
**Category:** flash\
**Created:** [February 7, 2005, 7:02pm UTC](https://forum.kirupa.com/t/targeting-objects-in-as2-classes/78722 "2005-02-07T19:02:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fr3sh\_pt](https://avatars.discourse-cdn.com/v4/letter/f/9de053/32.png) [@fr3sh\_pt](https://forum.kirupa.com/u/fr3sh_pt)\
**Post date:** [February 7, 2005, 7:02pm UTC](https://forum.kirupa.com/t/targeting-objects-in-as2-classes/78722/1 "2005-02-07T19:02:33Z")

</div>

[size=2]Hi,  
I’ve got a problem targeting objects is AS2 classes.  
In a class I have a multi-dimensional array with paths to some mc’s in the main timeline (caminho[‘mc’]).  
I need to reference them via method in a class, so i use something like this:

```auto
// **In the class, i have a method like this**
// after have built the caminho['mc'] in the constructor 
 
 
[font=Courier New][color=red]function myMethod[/color] (){[/font]
 
[font=Courier New]trace('1º Caminho MC na Classe: ' + caminho['mc']['mcLogin']);[/font]
 
[font=Courier New]trace('2º ' + eval(caminho['mc']['mcLogin'])._alpha);[/font]
 
[font=Courier New]trace('3º ' + _root.mcLogin._alpha);[/font] 
[font=Courier New]}[/font]
 
// In flash i've this output
[font=Courier New]1º Caminho MC na Classe: _root.mcLogin [color=gray]//the target is correct in array[/color]
2º undefined [color=gray]//can't get the alpha[/color]
3º 100 [color=gray]// directly i can: 100[/color]

```

[/font] **The question is… how can i target objects in the flash movie trought variable with the path to the objects in the class?**

Any help is welcome,

Álvaro

[size=1]Glups - Atelier de Novas Tecnologias, Lda  
Rua Jaime Campos, Bloco D, Piso 3º Esq.  
5000-431 Vila Real  
Portugal  
Tel. 259 322 183  
Fax 259 322 183  
E-mail Geral: [/size][[size=1]info@glups.pt[/size]](mailto:info@glups.pt)  
[size=1]E-mail Assistência: [/size][[size=1]assistencia@glups.pt[/size]](mailto:assistencia@glups.pt)  
[/size][[color=#0000ff][size=1]www.glups.pt[/size][/color]](http://www.kirupa.com/forum/www.glups.pt)[size=1] powered by human intelligence[/size]  
[size=2][size=1]© 2001-2005 Glups. Todos os Direitos Reservados[/size]  
[/size]
