Skip to main content
Participant
February 27, 2014
Answered

縦スクロールについて

  • February 27, 2014
  • 1 reply
  • 825 views

こんにちは、初めまして。


初投稿させていただきます。


掲題の件ですが、

トラックをクリック時に、1ページ分移動します。

トラックの一番下を長押しし、一番下へカーソルを移動した後で、

トラックを再クリック時に、2ページ分、3ページ分など移動しまう。

リファレンスを参照してもスクロールがらみの制御方法が不明で

手詰まり状態となっています。


どなたか情報をお持ちの方がいらっしゃいましたら

情報を共有いただけませんでしょうか?


以上です。


よろしくお願いいたします。

This topic has been closed for replies.
Correct answer kglad

i have used datagrid ,ComboBox,Canvas

the problem was discovered


create a new fla, add a datagrid to the library and the code below.  do you see any problem?

import fl.controls.DataGrid;

import fl.controls.ScrollPolicy;

import fl.data.DataProvider;

var i:uint;

var totalRows:uint = 100;

var dp:DataProvider = new DataProvider();

for (i = 0; i < totalRows; i++) {

    dp.addItem({col1:i, col2:Math.round(10*Math.random())});

}

var dg:DataGrid = new DataGrid();

dg.setSize(200, 300);

dg.columns = ["col1", "col2"];

dg.dataProvider = dp;

addChild(dg);

dg.verticalPageScrollSize=dg.height-dg.rowHeight;

1 reply

kglad
Community Expert
Community Expert
February 27, 2014

the ms translator made a mess of your message and google translate is not much better.

so, i don't know what you're asking but it seems to be a question about textfield scrolling.  if true, check the textfield's scrollV, maxScrollV and bottomScrollV properties and check all the getXXX() methods of the textfield.

EyesBlueAuthor
Participant
February 28, 2014

thank you for the answer

sorry for my weak English

when I click the track of the scrollbar,the datagrid 1 page scroll

but after i gave the track a long click,

i click the track once more, the datagrid 2 page or 3 page scroll

after a long click ,  when i click the track once more ,i want the datagrid also 1 page scroll

but i don't know how to do

kglad
Community Expert
Community Expert
February 28, 2014

use the verticalPageScrollSize to set the number of pixels you want your datagrid to scroll.  for most situations, picking a number less than or equal to the datagrid's height minus its rowHeight is what you'll want:

dg.verticalPageScrollSize=dg.height-dg.rowHeight;