MJWarren@Syr
07-14-2005, 03:42 PM
Im working in a component trying to make a simple action in an onPress. It must be somthing simple Im over looking. heres a bit of my code
public function drop() {
init();
children();
actions();
}
private function init() {
__width = _width;
if(_height<26)
__height = _height;
_xscale = 100;
_yscale = 100;
box._visible=false;
}
private function children() {
attachMovie("menu","menu",getNextHighestDepth());
attachMovie("leftEnd","leftEnd",getNextHighestDepth());
attachMovie("rightEnd","rightEnd",getNextHighestDepth());
attachMovie("_drop","_drop",getNextHighestDepth());
attachMovie("left_dropEnd","left_dropEnd",getNextHighestDepth());
attachMovie("right_dropEnd","right_dropEnd",getNextHighestDepth());
//attachMovie("blue","blue",getNextHighestDepth());
attachMovie("_arrowBox","_arrowBox",getNextHighestDepth());
attachMovie("_arrow","_arrow",getNextHighestDepth());
if(_y>(Stage.height-(_drop._height+menu._height))) {
_arrow._rotation=180;
down=false;
}
}
private function actions() {
_arrow.onPress = function() {
trace(down);
trace(leftEnd._x);
if(down==true) {
left_dropEnd._x=leftEnd._x;
left_dropEnd._y=menu._y+menu._height;
_drop._x=left_dropEnd._x;
_drop._y=left_dropEnd._y;
right_dropEnd._x=_drop._x;
right_dropEnd._y=_drop._y;
}
else if(down==false) {
left_dropEnd._x=leftEnd._x;
left_dropEnd._y=menu._y-left_dropEnd._height;
_drop._x=left_dropEnd._x;
_drop._y=left_dropEnd._y;
right_dropEnd._x=_drop._x;
right_dropEnd._y=_drop._y;
}
};
}
the actions i give in the onPress just dont work, both the traces display undefined. I just cant see what the problem is. anyone ever have similar problems? any help would be great.
-tron
public function drop() {
init();
children();
actions();
}
private function init() {
__width = _width;
if(_height<26)
__height = _height;
_xscale = 100;
_yscale = 100;
box._visible=false;
}
private function children() {
attachMovie("menu","menu",getNextHighestDepth());
attachMovie("leftEnd","leftEnd",getNextHighestDepth());
attachMovie("rightEnd","rightEnd",getNextHighestDepth());
attachMovie("_drop","_drop",getNextHighestDepth());
attachMovie("left_dropEnd","left_dropEnd",getNextHighestDepth());
attachMovie("right_dropEnd","right_dropEnd",getNextHighestDepth());
//attachMovie("blue","blue",getNextHighestDepth());
attachMovie("_arrowBox","_arrowBox",getNextHighestDepth());
attachMovie("_arrow","_arrow",getNextHighestDepth());
if(_y>(Stage.height-(_drop._height+menu._height))) {
_arrow._rotation=180;
down=false;
}
}
private function actions() {
_arrow.onPress = function() {
trace(down);
trace(leftEnd._x);
if(down==true) {
left_dropEnd._x=leftEnd._x;
left_dropEnd._y=menu._y+menu._height;
_drop._x=left_dropEnd._x;
_drop._y=left_dropEnd._y;
right_dropEnd._x=_drop._x;
right_dropEnd._y=_drop._y;
}
else if(down==false) {
left_dropEnd._x=leftEnd._x;
left_dropEnd._y=menu._y-left_dropEnd._height;
_drop._x=left_dropEnd._x;
_drop._y=left_dropEnd._y;
right_dropEnd._x=_drop._x;
right_dropEnd._y=_drop._y;
}
};
}
the actions i give in the onPress just dont work, both the traces display undefined. I just cant see what the problem is. anyone ever have similar problems? any help would be great.
-tron