Skip to main content
Participant
Feb 27, 2014 5:41 AM UTC
Answered

縦スクロールについて

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


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


掲題の件ですが、

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

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

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

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

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


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

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


以上です。


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

This topic is closed to new replies. Start a new post to keep the conversation going.
kglad
kgladCorrect answer
Community Expert
Mar 4, 2014 4:52 AM UTC

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;

8 replies

kglad
Community Expert
Community Expert
Feb 27, 2014 10:54 AM UTC

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.

Translate
EyesBlueAuthor
Participant
Feb 28, 2014 5:32 AM UTC

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

Translate
kglad
Community Expert
Community Expert
Feb 28, 2014 1:30 PM UTC

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;

Translate