# Advanced AS2 Coder needed

**URL:** https://forum.kirupa.com/t/advanced-as2-coder-needed/116973
**Category:** Uncategorized
**Created:** [July 23, 2004, 12:51am UTC](https://forum.kirupa.com/t/advanced-as2-coder-needed/116973 "2004-07-23T00:51:42Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![jewelsmith](https://avatars.discourse-cdn.com/v4/letter/j/a4c791/32.png) [@jewelsmith](https://forum.kirupa.com/u/jewelsmith)
#### Post date: [July 23, 2004, 12:51am UTC](https://forum.kirupa.com/t/advanced-as2-coder-needed/116973/1 "2004-07-23T00:51:42Z")

</div>

Hi,

I am looking for an Advanced AS2 Coder working in Flash mx 2004 to help me develop a Flash app based on an [ASP.Net](http://ASP.Net) Web service. I am just starting with Flash but I know what I am trying to build. Have several projects in the works so could be a long term part time relationship.  
I can send some test code if you want a look at where I am STUCK.  
John

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 23, 2004, 1:08am UTC](https://forum.kirupa.com/t/advanced-as2-coder-needed/116973/2 "2004-07-23T01:08:14Z")

</div>

I guess what mlk meant was it would make sense to post the part you are stuck.  
if it’s top secret - tell us the problem  
if it’s something commercial - feel free to pm me 😉

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 23, 2004, 2:00am UTC](https://forum.kirupa.com/t/advanced-as2-coder-needed/116973/3 "2004-07-23T02:00:11Z")

</div>

Well there are a few problems, but the first is this :

```
I am trying to get a handle on the MovieClip "ce12" by dropping the "Dragger"

```

MovieClip on it. I intend to put this in Class.as but here is the test Code:

////////////////////////////////////////  
// Layer 1 : Frame 1  
////////////////////////////////////////  
var mc:Cell = \_root.attachMovie(“CellSymbol”,“ce12” , 0);

mc.init(200, 200);  
trace("mc name : " + mc.\_name.toString);  
/////////////////////////////////////////////  
//Dragger Layer code  
////////////////////////////////////////////  
onClipEvent(mouseDown) {  
targetArray= new Array(“cat”, “dog”, “pig”, “ce12”);  
startDrag(this);

// put mc on top  
this.swapDepths(50)  
}  
on(release) {  
stopDrag();

for (c=0;c\< targetArray.length;c++) {  
Trace("Array : "+targetArray[c])

if (this.\_droptarget == ("/" + String(targetArray[c]))) {  
Trace(“String”+ “/” + String(targetArray[c]))

this.\_x = \_root.MovieClip(targetArray[c]).\_x;  
Trace("MovieClip : "+MovieClip(targetArray[c]))

this.\_y =\_root.\_level(targetArray[c]).\_y  
Trace("level : "+\_level(targetArray[c]))  
}  
else{  
this.\_x = 150;  
this.\_y =100;  
stopDrag();  
}  
}  
}

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 23, 2004, 3:53am UTC](https://forum.kirupa.com/t/advanced-as2-coder-needed/116973/4 "2004-07-23T03:53:47Z")

</div>

I just wanted to add.  
It may not be obvious, but I have many dynamically generated movieclips on the stage and I don’t know which one will be dropped on and I don’t want to write a 100 case [font=Courier New]switch[/font] statement.

Any Ideas?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 23, 2004, 12:58pm UTC](https://forum.kirupa.com/t/advanced-as2-coder-needed/116973/5 "2004-07-23T12:58:53Z")

</div>

ok, first:  
why are you using the

```auto
("/" + String(targetArray[c]))

```

you are probably looking for

```auto
(this._parent[targetArray[c]])

```

second:

```auto
_root.MovieClip(targetArray[c])._x;

```

won’t work.  
I guess you should try something like

```auto
_root[targetArray[c]]._x;

```

or

```auto
eval(targetArray[c])._x;

```

use eval if you have a variable path  
(i.e.: variable1=\_root.abc.def;  
eval(variable1).\_x //==\_root.abc.def.\_x)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 23, 2004, 4:12pm UTC](https://forum.kirupa.com/t/advanced-as2-coder-needed/116973/6 "2004-07-23T16:12:40Z")

</div>

Thank you I appreciate your quick feedback, McGiver!! You gave me what I needed to make it work :be:  
I was using ("/" + String(targetArray[c])) because the code worked when I used “/c12” for the path string.

```
The original code was 

```

if (this.\_droptarget == “/c12”) {  
this.\_x = \_root.c12.\_x;

(this.\_parent[targetArray[c]]) doesn’t work.  
("/" + [targetArray[c]])) Does work. :be:  
and so does  
\_root[targetArray[c]]

```
   What does enclosing the array value in [] do? Does [] force the casting? 

```

What am I casting to? Am I casting to an object or a Movieclip in " this.\_x = \_root.c12.\_x;"?

Thankyou Thankyou Thankyou Thankyou Thankyou Thankyou Thankyou

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 23, 2004, 5:57pm UTC](https://forum.kirupa.com/t/advanced-as2-coder-needed/116973/7 "2004-07-23T17:57:18Z")

</div>

so the “/” is actually part of the name?!  
I just wasn’t sure what you were trying to do with the slash thing.

the [] is makes flash read the code inside the brackets as a movieclip name.  
i.e.:  
\_root[“hallo”] is the same as \_root.hallo  
and  
i=5  
\_root[“mc”+i][“submc”+i] is read like \_root.mc5.submc5  
like  
eval("\_root.mc"+i+".submc"+i) if you have a complete path

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 24, 2004, 3:39am UTC](https://forum.kirupa.com/t/advanced-as2-coder-needed/116973/8 "2004-07-24T03:39:44Z")

</div>

Actually, no the “/” is part of the path string. I got this from the Flash Help if we want to use \_root[targetArray[c]] then we have to write something like  
(eval(this.\_droptarget) == \_root[targetArray[c]] ) but I don’t know why it doesn’t work with for instance “\_root/someMC”

Thanks for explain on the “\_root[“hallo”] is the same as \_root.hallo” thing.  
So why doesn’t \_root.MovieClip(targetArray[c]) (which I think is more precise casting) work ??

Is the [someMc] just for object paths? Or does MovieClip(someMc) just not work?
