Let's say I have a class Organize which handles my input. So in the main.swf I have action script that calls my Organize:ProcessUserInput() function on each frame. So something like this.
Code:
var Org:Organizer = new Organizer("_root.instMain.instSub");
_root.onEnterFrame(){
Org.ProcessUserInput();
}
Now the Organizer constructor takes a String paramter. This parameter is an absolute path to an instance of a movieClip on the screen. So looking at the string provided above, I have a movieClip with the instance name 'instMain.' Then I have a sub movieClip to that instance with the instance name 'instSub.' So that makes the absolute path to the sub movieClip '_root.instMain.instSub.' So next, here's my Organizer.as file.
Code:
class Organizer{
private var:String m_pathSubMovieClip;
Organizer(pathSubMovieClip:String){
this.m_pathSubMovieClip = pathSubMovieClip;
}
public function ProcessUserInput():Void{
//This function will be shown again below after I illustrate
//the rest of my problem.
}
}
So now we finally get to the questioned summarized in the subject of this thread. When you have an absolute path to an object represented as a String, you can use setProperty() to update it. So if I wanted to move the movie passed above to the 10 pixels I could use getProperty and setProperty like so.
Code:
var tmpXval:Number = getProperty(this.pathSubMovieClip, _x);
setProperty(this.m_pathSubMovieClip, _x, tmpXval + 10);
So what I want to do is to be able to check and see if the mouse is pressed on my movie clip, if it's not inside my movie clip or if it is released over my movie clip using the absolute path stored as a string that I have in my Organizer class. So here's some pseudo code to show what I'm going for. It's the ProcessUserInput() function;
Code:
public function ProcessUserInput():Void{
if(/*mouse is over this.m_pathSubMovieClip*/){
if(/*mouse is down*/){
//do whatever
}
else{
//do whatever
}
}
So after making a simple question really long, here's my question summarized. I have a movie clips absolute path as a String. I want to use that string to check mouse collision with the movie clip. I can't use onClipEvent or at least I'm not sure how I would do that with only the absolute path as a string. I kind of wrote this up on the fly and all this code is hypothetical so there could be some errors. Please help

.