Flash Expert Needed!

can anyone help me im making this thing so when you click somwhere on the screen the person moves there and avoids objects is there a way

thanks

                              Flash Monkey:cool:

uh… this? :beam:

http://www.kirupaforum.com/forums/showthread.php?threadid=28294

can you give an example?

like on age of empires you click somwhere on the screen your person goes to that point

anyone?

he wants path finding.

there is no easy script to that. you have to tell it to walk in the direction of the thing, and when ever it runs into something, figure out what shape it is, and go around it. good luck.

any good website on pathfinding you know?

no. the code i can think of is really simple, and takes alot of short cuts. and will only work if it is simple obsticles like a box in the way. advanced path finding can figure out and actual route,

it goes something like, when you click it will go there

[AS]onClipEvent (mouseDown) {
endX = _root._xmouse;
endY = _root._ymouse;
tempendX = null;
tempendY = null;
}[/AS]

and it will have an onClipEvent (enterFrame) with a looped hitTest inside that will check to see if it has hit the box. when it does, it will check the dimensions of the box, the box’s _x and _y cordinates is, where it is itself in comparison to the box. set the temp x/y cordinates, walk around. continue the loop and see if it has cleared the box, if it has, will head straight for the target, if not will continue trying to get around the box. etc etc.

you know, people get paid to figure this kind of thing out.

it dint work can you explain in more deatil where to put the script?

thats not the complete script. its no where near that. for me, it would take about a week at most to create a working script.