How to make list scrolling only with mouse (actionscript 3) - actionscript-3

You can see this list here http://www.studia-kuhni.ru/exec.swf.
List.change
List.itemRollOut
List.itemRollOver
List.scroll
What I should use? How I can scroll list as like as on that swf? (i know about tweenmax, question about scrolling)
May be somebody know beautiful and well made examples?
Thank you.

Try using List.scroll listener, and update 'selectedIndex' with respect to the scroll direction. For eg., my_list.selectedIndex += 1 to select the next item.

Related

single scroll bar for multiple lists boxes. flash CS6

I have been having issues getting a single scrollbar to work with multiple list boxes. I wanted something similar to how Excel does it visually
i ended up using a slider bar and using the value of this bar to change the selectedIndex of the list box. This did not work however.
This is the code i was using:
import flash.events.MouseEvent;
slider1.addEventListener(MouseEvent.MOUSE_OVER,scrolling);
function scrolling(evt:MouseEvent)
{
trace(slider1.value);
slider1.maximum=InstanceName_1.length;
InstanceName_1.selectedIndex=slider1.value;
InstanceName_2.selectedIndex=slider1.value;
InstanceName_3.selectedIndex=slider1.value;
InstanceName_4.selectedIndex=slider1.value;
}
with InstanceName_n being the different lists i used.
Thank you so much in advance!
I think the listener function is wrong, try using this
slider1.addEventListener(MouseEvent.MOUSE_MOVE,scrolling);
this might help , because this is when mouse is down and is moving , normally used for drag/drop times , still you can try it , it will work

Flash CS6 / AS3: Drag and Resize a rectangle movieclip

Not sure if this is possible but going to ask: is there a way of being able to resize a symbol (in this case, a movie clip) in an swf file by clicking and dragging it with your cursor?
One of the things I need to do is have a rectangle within my published swf file that can be resized in height and width by clicking and dragging the sides or corner of the rectangle. Not sure at all how to do this, though. Any tutorials I could look at or maybe something that's somewhat easy to do/explain here? Right now from what little I've found on the subject, it seems like a complex thing to do.
Thanks.
There is no standard option for that, so you have to code it yourself. My suggestion:
You could add a small MovieClip, looking like an arrow, right next to your scalable item. Make this arrow horizontally draggable and whenever you drag this arrow, update the width of the scalable item according to the new position of the arrow. In this case you can scale your item horizontally, but you can use the same approach to make it vertically or diagonally scalable.
#Lodewijck - Your suggestion worked, thank you!!
This may not be the best way to write the code but it worked:
stop();
import flash.events.MouseEvent;
stage.addEventListener(MouseEvent.MOUSE_MOVE,resize1);
this.addEventListener(MouseEvent.MOUSE_DOWN, startDragging, true);
this.addEventListener(MouseEvent.MOUSE_UP, stopDragging, true);
function startDragging(e:MouseEvent) {
dragsquare.startDrag();
}
function stopDragging(e:MouseEvent) {
dragsquare.stopDrag();
}
function resize1(E:MouseEvent){
square1.width=dragsquare.x - square1.x;
square1.height=dragsquare.y - square1.y;
}

What is this called, and how do i replicated it in CSS?

I know the title stinks, but as it says i have no idea what the name is for what i want to create.
I want to do a list of links (or rather a menu if you prefer, but with no drop down), that looks like this:
This is just an example so it isnt very pretty. Its having those arrows in each box, and have them "connected" to eachother, but each box is an individual element. I think this type of style has a name, what is it called? Will help greatly searching for help.
I wish to achieve this by making the elements purely by CSS, and the closest i have come is help from this page: http://www.css3shapes.com/ but i just cant combine them to create the menu.
Any and all kinds of help is appreciated.
It's called BreadCrumbs.
It's easier to "paint" it than you think.
Here's a tip:
This is a single arrow:
And the magic:
We used to call it breadcrumbs with arrowboxes. But its up to you. I dont think there is a generic name.
Check out these links
- http://www.red-team-design.com/css3-breadcrumbs
- http://thecodeplayer.com/walkthrough/css3-breadcrumb-navigation

Java swing CheckBox is not visible in JCheckBoxMenuItem

The checkbox icon is not visible in my JCheckBoxMenuItem..I add this JCheckBoxMenuItem to JideMenu which extends JMenu.How to make this checkbox visible eventhough if it is not selected..?
Thanks in advance.
I'm not entirely certain where your problem is coming from. It sounds that just the checkbox component isn't visible, while all other MenuItem types are showing up on the Menu.
I'm not very experienced with the Swing library, but if you could put a few lines of code regarding your Menu/MenuItems, I'm certain you'll get a much better answer.
Taking a shot in the dark, you mention that the MenuItem (checkbox) is added to the menu, but have you added the menu into a MenuBar/JMenuBar object and set your JFrame to use that Bar via the setMenuBar() method? This is under the assumption that the entire menu isn't showing up (not just the checkbox component), but figured I'm try to preempt a solution here.
menuBar = new JMenuBar();
menu = new JMenu("A Menu");
menuBar.add(menu);
cbMenuItem = new JCheckBoxMenuItem("A check box menu item");
menu.add(cbMenuItem);
It´s pretty much straightforward and taken directly from here. I guess it´s all anyone can say about it until you show us your code.
setState(true) will show the checkmark… IIRC there's also a constructor that you can pass a boolean if you want it created with the checkmark visible.

JScrollBar, remove keyListener?

Hey you all, just a quick question of what i havent found anywhere. Im adding a scrollpane to a JPanel, with 2 JScrollBars. One vertical and one horizontal. Everything works fine just that i dont want the ScrollBars to scroll using the arrow keys. How do i achieve this?
I´ve been checking out adjustmentlisteners but really havent found anything of high value to me. Thanks for any help!
you have to tweak the keybinding in the scrollPane's inputMap and point the navigation keys into nirwana, like:
InputMap inputMap = scrollPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
inputMap.put(KeyStroke.getKeyStroke("RIGHT"), "do-nothing");
// same for all navigation keys you want to disable
...
to find which keyStrokes are registered, look into the BasicLookFeel - the section in getDefaults which relates to "ScrollPane"
Beware: that's highly unusual, you user's might be annoyed!