Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Scrolling Question?

New Here ,
Apr 11, 2014 Apr 11, 2014

Clip_3.jpg

any solution for this...this is combobox compenent.

any solution?

TOPICS
ActionScript
2.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 15, 2014 Apr 15, 2014

use;

var m: Number;

var b: Number;

combo_box.addEventListener(MouseEvent.MOUSE_DOWN, startscrollF);

function startscrollF(event: MouseEvent): void {

    paramF(combo_box.mouseY, combo_box.dropdown.verticalScrollPosition, combo_box.dropdown.height - 10, combo_box.dropdown.maxVerticalScrollPosition);

    this.addEventListener(Event.ENTER_FRAME, scrollF);

    stage.addEventListener(MouseEvent.MOUSE_UP, stopscrollF);

}

function scrollF(e: Event): void {

    combo_box.dropdown.verticalScrollPosition = Math.rou

...
Translate
Community Expert ,
Apr 11, 2014 Apr 11, 2014

you can reference the scrollbar using your cb's dropdown's verticalScrollBar property.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 11, 2014 Apr 11, 2014

Try this: When a user puts their finger on the list to start scrolling, have a variable track where they put their finger down, and have a timer update the CB's scroll amount by how much they have moved their finger from the original area where they put it down.

An example of a code to go along with this is:

var start_finger_position:Number

combo_box.addEventListener(MouseEvent.MOUSE_OVER, fl_hover);

function fl_hover(event:MouseEvent):void

{

    start_finger_position = mouseY

}

//insert timer listener and function here

//timer code:

{

combo_box.verticalScrollbar.scroll = combo_box.verticalScrollbar.scroll + (mouseY - start_finger_position)

}

(The timer updates the scroll, so have an interval of about 10-50)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 12, 2014 Apr 12, 2014

sorry, i was try my best... i cant understand this coding work...need your help.. may i get the full coding?

var textFormat:TextFormat = new TextFormat();

textFormat.font = "Trebuchet MS";

textFormat.size = 50;

combobox.textField.setStyle("textFormat", textFormat);

combobox.rowCount = 8;

combobox.dropdown.rowHeight = 55;

combobox.dropdown.setRendererStyle("textFormat", textFormat);

combobox.addItem( {label: "BKB1"} );

combobox.addItem( {label: "BKB2"} );

combobox.addItem( {label: "BKB3"} );

combobox.addItem( {label: "BKB4"} );

combobox.addItem( {label: "BKB5"} );

combobox.addItem( {label: "BKB6"} );

combobox.addItem( {label: "BKB7"} );

combobox.addItem( {label: "BKB8"} );

combobox.addItem( {label: "BKB9"} );

combobox.addItem( {label: "BKB10"} );

combobox.addEventListener(Event.CHANGE, changeimage);

function changeimage(event:Event):void{

 

          if (combobox.selectedItem.label=="BKB1")gotoAndStop(2);

          if (combobox.selectedItem.label=="BKB2")gotoAndStop(3);

          if (combobox.selectedItem.label=="BKB3")gotoAndStop(4);

          if (combobox.selectedItem.label=="BKB4")gotoAndStop(5);

          if (combobox.selectedItem.label=="BKB5")gotoAndStop(6);

          if (combobox.selectedItem.label=="BKB6")gotoAndStop(7);

          if (combobox.selectedItem.label=="BKB7")gotoAndStop(8);

          if (combobox.selectedItem.label=="BKB8")gotoAndStop(9);

          if (combobox.selectedItem.label=="BKB9")gotoAndStop(10);

          if (combobox.selectedItem.label=="BKB10")gotoAndStop(11);

 

}

this my combobox coding...

thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 12, 2014 Apr 12, 2014

again, the combobox has no verticalScrollBar property.  use:

combobox.dropdown.verticalScrollBar as in

combobox.addEventListener(Event.OPEN,f);

function f(e:Event):void{

stage.invalidate();

this.addEventListener(Event.RENDER,ff);

}

function ff(e:Event):void{

combobox.dropdown.verticalScrollBar.visible = false;

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 12, 2014 Apr 12, 2014

this success hide vertical scroll bar.But i need use hand to scroll down without using vertical scroll bar.

Can help ? thanks a lot for help.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 12, 2014 Apr 12, 2014

then use a mousedown listener to start a loop (like enterframe) that terminates on mouseup and repeatedly updates the combobox'es dropdown's verticalScrollPosition.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 13, 2014 Apr 13, 2014

Need more help... can give example coding?

i was try use this coding but i cant coding it...

var start_finger_position:Number

combo_box.addEventListener(MouseEvent.MOUSE_OVER, fl_hover);

function fl_hover(event:MouseEvent):void

{

    start_finger_position = mouseY

}

//insert timer listener and function here

//timer code:

{

combo_box.verticalScrollbar.scroll = combo_box.verticalScrollbar.scroll + (mouseY - start_finger_position)

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 13, 2014 Apr 13, 2014

var m:Number;

var b:Number;

combo_box.addEventListener(MouseEvent.MOUSE_DOWN, startscrollF);

function startscrollF(event:MouseEvent):void {

paramF(combo_box.mouseY,combo_box.scrollPosition,combo_box.height-10,combo_box.maxScrollPosition);

this.addEventListener(Event.ENTER_FRAME,scrollF);

this.addEventListener(MouseEvent.MOUSE_UP,stopscrollF);

}

function scrollF(e:Event):void{

combo_box.scrollPosition=Math.round(Math.min(combo_box.mouseY*m+b,combo_box.maxScrollPosition));

}

function stopscrollF(e:Event):void{

this.removeEventListener(Event.ENTER_FRAME,scrollF);

}

function paramF(x1:Number,y1:Number,x2:Number,y2:Number):void{

m=(y1-y2)/(x1-x2);

b=m*x1-y1;

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 14, 2014 Apr 14, 2014
Scene 2, Layer 'As', Frame 1, Line 531119: Access of possibly undefined property scrollPosition through a reference with static type fl.controls:ComboBox.
Scene 2, Layer 'As', Frame 1, Line 531119: Access of possibly undefined property maxScrollPosition through a reference with static type fl.controls:ComboBox.
Scene 2, Layer 'As', Frame 1, Line 481119: Access of possibly undefined property maxScrollPosition through a reference with static type fl.controls:ComboBox.
Scene 2, Layer 'As', Frame 1, Line 481119: Access of possibly undefined property scrollPosition through a reference with static type fl.controls:ComboBox.

this is the error i get...

i apply this into combobox

var m:Number;

var b:Number;

combobox.addEventListener(MouseEvent.MOUSE_DOWN, startscrollF);

function startscrollF(event:MouseEvent):void {

paramF(combobox.mouseY,combobox.scrollPosition,combobox.height-10,combobox.maxScrollPosition);

this.addEventListener(Event.ENTER_FRAME,scrollF);

this.addEventListener(MouseEvent.MOUSE_UP,stopscrollF);

}

function scrollF(e:Event):void{

combobox.scrollPosition=Math.round(Math.min(combobox.mouseY*m+b,combobox.maxScrollPosition));

}

function stopscrollF(e:Event):void{

this.removeEventListener(Event.ENTER_FRAME,scrollF);

}

function paramF(x1:Number,y1:Number,x2:Number,y2:Number):void{

m=(y1-y2)/(x1-x2);

b=m*x1-y1;

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 14, 2014 Apr 14, 2014

try

var m:Number;

var b:Number;

combo_box.addEventListener(MouseEvent.MOUSE_DOWN, startscrollF);

function startscrollF(event:MouseEvent):void {

paramF(combo_box.mouseY,combo_box.dropdown.verticalScrollPosition,combo_box.height-10,combo_box.dropdown.maxVerticalScrollPosition);

this.addEventListener(Event.ENTER_FRAME,scrollF);

this.addEventListener(MouseEvent.MOUSE_UP,stopscrollF);

}

function scrollF(e:Event):void{

combo_box.dropdown.scrollPosition=Math.round(Math.min(combo_box.mouseY*m+b,comb o_box.dropdown.maxVerticalScrollPosition));

}

function stopscrollF(e:Event):void{

this.removeEventListener(Event.ENTER_FRAME,scrollF);

}

function paramF(x1:Number,y1:Number,x2:Number,y2:Number):void{

m=(y1-y2)/(x1-x2);

b=m*x1-y1;

}

p.s. you may need to use a render event (shown in message 4).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 14, 2014 Apr 14, 2014

Clip_2.jpg

The result i get from this coding. The scroll Bar start from bottom and scrollpane cannot scrolling.

I was test on mobile phone.

coding i use:

var m:Number;

var b:Number;

combobox.addEventListener(MouseEvent.MOUSE_DOWN, startscrollF);

function startscrollF(event:MouseEvent):void {

paramF(combobox.mouseY,combobox.dropdown.verticalScrollPosition,combobox.height-10,combobox.dropdown.maxVerticalScrollPosition);

this.addEventListener(Event.ENTER_FRAME,scrollF);

this.addEventListener(MouseEvent.MOUSE_UP,stopscrollF);

}

function scrollF(e:Event):void{

combobox.dropdown.verticalScrollPosition=Math.round(Math.min(combobox.mouseY *m+b,combobox.dropdown.maxVerticalScrollPosition));

}

function stopscrollF(e:Event):void{

this.removeEventListener(Event.ENTER_FRAME,scrollF);

}

function paramF(x1:Number,y1:Number,x2:Number,y2:Number):void{

m=(y1-y2)/(x1-x2);

b=m*x1-y1;

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 15, 2014 Apr 15, 2014

use;

var m: Number;

var b: Number;

combo_box.addEventListener(MouseEvent.MOUSE_DOWN, startscrollF);

function startscrollF(event: MouseEvent): void {

    paramF(combo_box.mouseY, combo_box.dropdown.verticalScrollPosition, combo_box.dropdown.height - 10, combo_box.dropdown.maxVerticalScrollPosition);

    this.addEventListener(Event.ENTER_FRAME, scrollF);

    stage.addEventListener(MouseEvent.MOUSE_UP, stopscrollF);

}

function scrollF(e: Event): void {

    combo_box.dropdown.verticalScrollPosition = Math.round(Math.min(combo_box.dropdown.mouseY * m + b, combo_box.dropdown.maxVerticalScrollPosition));

}

function stopscrollF(e: Event): void {

    this.removeEventListener(Event.ENTER_FRAME, scrollF);

}

function paramF(x1: Number, y1: Number, x2: Number, y2: Number): void {

    m = (y1 - y2) / (x1 - x2);

    b = m * x1 - y1;

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 16, 2014 Apr 16, 2014

emm.... this coding no error but still unable scroll the combobox...i try few times ald..

the combobox still function as normal combobox..

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 16, 2014 Apr 16, 2014

create a new fla, add a combobox to the stage and assign its instance name combo_box.

use the properties panel to add items to the combobox.

copy the code in message 12 and paste it into the actions panel.

test.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 16, 2014 Apr 16, 2014

i test with AS3 and Air for Android

follow the step.

-combobox instance name= combo_box

-properties panel(data provider)= add name

-copy message12 as AS.

-test

result: Still same as before.cannot scolling

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 16, 2014 Apr 16, 2014

test it in flash pro.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 16, 2014 Apr 16, 2014

i need develop android App.

i using Adobe Flash Professional CS6(AIR for Android) for development..

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 16, 2014 Apr 16, 2014

i know.

test in flash pro.

if that fails you've done something wrong. 

if that works, that's as much help as i give via the forums.  testing on mobile devices is too time-consuming (for me) to do free of charge.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 16, 2014 Apr 16, 2014

tert.jpg

done test...cant scroll with mouse click ..

still have same problem.

sorry for taking you too much time

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 16, 2014 Apr 16, 2014

you don't scroll with a mouse click.  you mouse down and drag your mouse.

try, http://www.kglad.com/Files/forums/test2.html

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 16, 2014 Apr 16, 2014

ya...i get it...before that i open the combobox and drag so cant make it...

finally solve this problem.

Thanks you very much.

sorry take u a lot of time .

thanks for always helping me..

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 17, 2014 Apr 17, 2014
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines