Actionscript 3 滚动到movieclips页面的特定部分不适用于搜索选项

Actionscript 3 滚动到movieclips页面的特定部分不适用于搜索选项,actionscript-3,flash-cs6,Actionscript 3,Flash Cs6,我有一本书的菜单页,其中包含一个可滚动的父movieclip,它有27个子电影剪辑。我添加了键盘输入来滚动它。现在我在菜单页中添加了一个搜索按钮和一个输入文本字段。假设用户想要打开第12部分或第20部分或其他部分,他/她将在文本字段中写入12/20或其他内容,然后单击搜索按钮,然后它将向上/向下滚动,并显示特定部分12/20的位置。我试着用一个条件来解决这个问题,当输入到文本字段的值在7到13之间时,父剪辑的y轴向下滚动,其中doublescrollstep变量为500,显示部分7到12;当输入

我有一本书的菜单页,其中包含一个可滚动的父movieclip,它有27个子电影剪辑。我添加了键盘输入来滚动它。现在我在菜单页中添加了一个搜索按钮和一个输入文本字段。假设用户想要打开第12部分或第20部分或其他部分,他/她将在文本字段中写入12/20或其他内容,然后单击搜索按钮,然后它将向上/向下滚动,并显示特定部分12/20的位置。我试着用一个条件来解决这个问题,当输入到文本字段的值在7到13之间时,父剪辑的y轴向下滚动,其中doublescrollstep变量为500,显示部分7到12;当输入值为13到18时,父剪辑的y轴向下滚动,其中tripplescrollstep变量为1000,显示部分13到18。但它正在向下滚动。如果我想向上滚动,我该怎么办? 这是我的密码:

pat_index.mask = mask_mov;
var goY:Number = pat_index.y;
var initY:Number = pat_index.y;
var singleScrollStep:Number = 30;
bt_slider.height = slider_lane.height / pat_index.height * mask_mov.height;
slider_lane.y +=  bt_slider.height / 2;
slider_lane.height -=  bt_slider.height;
bt_slider.y = slider_lane.y;
var sliderInitY:Number = bt_slider.y;
var sliderStepPerPercent:Number = slider_lane.height / 100;
var scrolledPercent:Number;
stage.addEventListener(Event.ENTER_FRAME, scrollManager);
function scrollManager(Event):void
{
pat_index.y += (goY - pat_index.y)/5;
scrolledPercent = ((pat_index.y-initY)*100/(mask_mov.height - pat_index.height));
bt_slider.y = sliderInitY + sliderStepPerPercent * scrolledPercent;

if (scrolledPercent > 100)
{
    goY = initY - pat_index.height + mask_mov.height;
}
if (scrolledPercent < 0)
{
    goY = initY;
}
}

inputbox.restrict="0-9";
inputbox.maxChars=3;
search.buttonMode=true;
search.addEventListener(MouseEvent.MOUSE_DOWN, searchDown);
function searchDown(event:MouseEvent):void
{
    var variable:Number;
    variable= Number(inputbox.text);
    trace(variable);
if(variable>6 && variable<13)
{
    if (pat_index.y - singleScrollStep + goY < initY - pat_index.height + mask_mov.height)
    {
        goY = initY - pat_index.height + mask_mov.height;
    }
    else
    {
        goY -=  doubleScrollStep;
    }
    /*if (pat_index.y + singleScrollStep + goY >= initY)
    {
        goY = initY;
    }
    else
    {
        goY +=  doubleScrollStep;
    }*/
}
if(variable>=13 && variable<18)
{
    if (pat_index.y - singleScrollStep + goY < initY - pat_index.height + mask_mov.height)
    {
        goY = initY - pat_index.height + mask_mov.height;
    }
    else
    {
        goY -=  trippleScrollStep;
    }
}
}}
pat_index.mask=mask_mov;
var goY:Number=pat_index.y;
变量:编号=pat_index.y;
var-singleScrollStep:Number=30;
bt_slider.height=slider_lane.height/pat_index.height*mask_mov.height;
滑块y+=bt\U滑块高度/2;
slider_lane.height-=bt_slider.height;
bt_slider.y=slider_lane.y;
var sliderInitY:Number=bt_slider.y;
var sliderStepPerPercent:Number=滑块\车道高度/100;
var scrolledPercent:数字;
stage.addEventListener(Event.ENTER_FRAME,scrollManager);
功能滚动管理器(事件):无效
{
pat_index.y+=(goY-pat_index.y)/5;
scrolledPercent=((pat_index.y-initY)*100/(mask_mov.height-pat_index.height));
bt_slider.y=sliderInitY+sliderStepPerPercent*scrolledPercent;
如果(滚动百分比>100)
{
goY=initY-八度指数高度+遮罩移动高度;
}
如果(滚动百分比<0)
{
goY=0;
}
}
inputbox.restrict=“0-9”;
inputbox.maxChars=3;
search.buttonMode=true;
search.addEventListener(MouseEvent.MOUSE_DOWN,searchDown);
函数searchDown(事件:MouseEvent):void
{
var变量:数字;
变量=编号(inputbox.text);
跟踪(变量);
如果(变量>6&&variable=0)
{
goY=0;
}
其他的
{
goY+=双阶梯;
}*/
}
如果(variable>=13&&variable这是已更改的fla文件,我必须连续上下滚动..如何使电影剪辑根据输入向上/向下滚动:(