The code you quote searches a 128 x 128 image for red pixels, and calls the Movie Script handler "on createTrees()" if it finds one. In fact, it calls the handler every time it finds a red pixel, but it doesn't give any information about where the tree should be created. A call to createTree(x, y) would be more intelligent.
You want something quite different.
You want to move a box around, but only to points where your map is a particular colour. One solution would be to place the map as a texture on the terrain. If you are planning to move the box to a particular location, you could first send a ray downwards from that location, to check where it intersects with the terrain. You could then use the code that you can find >here< to test the color of the pixel in the texture at that point on the terrain.
If the color is the one you are using for the path on your map, then you can move your box to the planned point.
I gave the wrong impression with the code I included earlier in that it was only the part I considered most relevant to the problem and the approach I had taken. It's from 3D for the Web and the whole of it allows one to landscape a terrain based on image maps very nicely but it's only suited to static situations. The authors discussed a number of ways of using image maps to limit the motion of a character but didn't provide finished examples. Image maps seem to me to have several advantages over other forms of collision detection in that one wouldn't have to create extra polys as collision hulls, could easily move the character around features of assorted heights and shapes, and could confine movements to specific paths even on a flat terrain. I think it's a great idea but I can't get it to work. I can see that modelsUnderRay is able to bridge the gap between 2D and 3D by its ability to give UvCoord data but I'm confused as to how to use it and I have not been able to find any examples showing specifically how to write the code to do so. http://homepage.mac.com/nephilim/sw3ddev/uvpicking.html is tantalizing in that he talks about many useful capabilities provided by combining imaging Lingo and modelsUnderRay and provides a copy of your code to make it possible to do so but all the specific examples are done with modelsUnderLoc which seems to me to be fundamentally different. It has to do with the mouse and camera. These are things Director is designed to 'know' about as indicated by all of the reserved words that have to do with mouse locations and actions. With models it's necessary to give all of that info to Director with code - and I'm confounded as to how to go about it.
I've modified your example to approximate what I'd like to do, so far without 'breaking' it. ModelsUnderLoc elicits a "hit" when the mouse is over the opaque texture of the plane model. I've got a box 'character' made that can be moved with the arrow keys over the plane model. http://www.elfstonestudio.com/modelsUnderRayUVTest.htm , http://www.elfstonestudio.com/modelsUnderRayUVTest.zipPlease show me how to use modelsUnderRay to get a similar reaction. I think (hope) I will be able to figure out how to control the motion of the character based on the color or alpha of the texture after that. I think the solution to this problem would be helpful to one of the other people who recently posted a question as well. I appreciate the help you've given so far and wish I could have made better use of it but I unfortunately need more guidance.