DiscipleX
09-02-2006, 12:05 AM
Hey guys, I just started diving into components and am sort of getting the jist of it. Mainly I'm interested in creating my own components and am starting off with the basics.
What I'm trying to do is, target an object using a component variable, but I'm not sure what type to use, or in general any rules about this. Basically this is where I'm at right now, and I'm not seeing what the trouble is:
This is on the frame level within the component:
this.onKeyDown = function () {
if (Key.getCode() == Key.UP) {
Selection.setFocus(_parent.focusUp);
}
else {
if (Key.getCode() == Key.DOWN) {
Selection.setFocus(_parent.focusDown);
}
}
}
focusUp and focusDown are variables within the parameter, at the moment set to String type, which outputs what I want using trace, but doesn't seem to get filled in at the script level. At the root level the variables point to other movieclips (ie: movie1, movie2, ect...). When I type the names in normaly like: Selection.setFocus(_parent.movie1);
It works fine. Just not sure what to use.
What I'm trying to do is, target an object using a component variable, but I'm not sure what type to use, or in general any rules about this. Basically this is where I'm at right now, and I'm not seeing what the trouble is:
This is on the frame level within the component:
this.onKeyDown = function () {
if (Key.getCode() == Key.UP) {
Selection.setFocus(_parent.focusUp);
}
else {
if (Key.getCode() == Key.DOWN) {
Selection.setFocus(_parent.focusDown);
}
}
}
focusUp and focusDown are variables within the parameter, at the moment set to String type, which outputs what I want using trace, but doesn't seem to get filled in at the script level. At the root level the variables point to other movieclips (ie: movie1, movie2, ect...). When I type the names in normaly like: Selection.setFocus(_parent.movie1);
It works fine. Just not sure what to use.