Copy link to clipboard
Copied
any solution for this...this is combobox compenent.
any solution?
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
...Copy link to clipboard
Copied
you can reference the scrollbar using your cb's dropdown's verticalScrollBar property.
Copy link to clipboard
Copied
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)
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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;
}
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
then use a mousedown listener to start a loop (like enterframe) that terminates on mouseup and repeatedly updates the combobox'es dropdown's verticalScrollPosition.
Copy link to clipboard
Copied
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)
}
Copy link to clipboard
Copied
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;
}
Copy link to clipboard
Copied
Scene 2, Layer 'As', Frame 1, Line 53 | 1119: Access of possibly undefined property scrollPosition through a reference with static type fl.controls:ComboBox. |
Scene 2, Layer 'As', Frame 1, Line 53 | 1119: Access of possibly undefined property maxScrollPosition through a reference with static type fl.controls:ComboBox. |
Scene 2, Layer 'As', Frame 1, Line 48 | 1119: Access of possibly undefined property maxScrollPosition through a reference with static type fl.controls:ComboBox. |
Scene 2, Layer 'As', Frame 1, Line 48 | 1119: 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;
}
Copy link to clipboard
Copied
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).
Copy link to clipboard
Copied
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;
}
Copy link to clipboard
Copied
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;
}
Copy link to clipboard
Copied
emm.... this coding no error but still unable scroll the combobox...i try few times ald..
the combobox still function as normal combobox..
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
test it in flash pro.
Copy link to clipboard
Copied
i need develop android App.
i using Adobe Flash Professional CS6(AIR for Android) for development..
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
done test...cant scroll with mouse click ..
still have same problem.
sorry for taking you too much time
Copy link to clipboard
Copied
you don't scroll with a mouse click. you mouse down and drag your mouse.
Copy link to clipboard
Copied
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..
Copy link to clipboard
Copied
you're welcome.