Button Scroll

Subscribe to Button Scroll 17 posts

avatar for Tanst Tanst 46 posts
Flag Post

http://www.youtube.com/watch?v=rVTcXf3vFx0

So I’m trying to create a menu of buttons on a scrolling bar like the text in this video. Does anyone have any advice for how to pull this off correctly?

 
avatar for NineFiveThree NineFiveThree 1370 posts
Flag Post

What exactly do you have problems with?

Do you know how to make a button?
Do you know how to make scrollable content?

All you need to do now is combine both things.

 
avatar for Tanst Tanst 46 posts
Flag Post

“What exactly do you have problems with?” -NineFineThree

I can make scrollable text but that’s it. I want to be able to make scrollable content which I can interact with. I know how to make a button. I know how to make an animation. I know how to scroll text, but I don’t know how to scroll anything else like a group of buttons.

 
avatar for Draco18s Draco18s 6860 posts
Flag Post

Play around with making a generic scrollable content object. It’s not that hard and I’ve made like twelve of them from scratch.

Hint: it’s all about ratios.

 
avatar for NineFiveThree NineFiveThree 1370 posts
Flag Post
Originally posted by Tanst:

I know how to scroll text, but I don’t know how to scroll anything else like a group of buttons.

So I assume in your video you use a textfield and a scrollbar?
If you like using components, you can simply use the scrollPane component.

Or build your own, which isn’t that hard, as draco pointed out.

 
avatar for Tanst Tanst 46 posts
Flag Post

It’s not so much that it’s hard I just don’t see the option to do so listed anywhere. I know it’s easy to do it’s just there are like 5,000 different places for it to hide. Here is what I mean: http://www.youtube.com/watch?v=zRDiOYCfZTM

I know for the text box you can just click it and make it scrollable but for anything else how does it work?

 
avatar for Tanst Tanst 46 posts
Flag Post

Ah I didn’t know of the scroll plane component, I’ll play around with it a bit and check back.

 
avatar for Tanst Tanst 46 posts
Flag Post

Okay so after messing aroud with the scroll plane component it seems that I can get scrolling shapes to work as well but when I turn things into buttons the buttons do not appear to work: http://www.youtube.com/watch?v=GznduxiYIpU

Anyone see what I’m doing wrong?

(sorry for the end of the video I was trying to stop the player but appearntly had more then one instance running)

 
avatar for Draco18s Draco18s 6860 posts
Flag Post
Originally posted by Tanst:

It’s not so much that it’s hard I just don’t see the option to do so listed anywhere. I know it’s easy to do it’s just there are like 5,000 different places for it to hide.

WTF. Just make one. It takes four movieclips and about 30 lines of ActionScript.

I once had to make a scroller that scrolled along a curve damn it. You want hard? That’s hard.

 
avatar for NineFiveThree NineFiveThree 1370 posts
Flag Post

The Problem is that you are nesting the code.
This is independent from building the scroll pane yourself or using the component.

When you have a timeline and place code on it:

gotoAndStop(42);
It will try to find the frame 42 on the timeline you placed that code on and if it finds it, go there.

gotoAndPlay will not magically find the timeline that you want to manipulate.
You have to call this function on the correct object, which seems to be your main timeline.

To make this work, do not place the code on the button container, but on the main timeline.
From there, you should be able to do something like this:

containerInstanceName.buttonInstanceName.addEventListener(...);
I’m not sure if that’s still the way the Flash IDE works in As3, maybe you have to use getChildByName();

 
avatar for Tanst Tanst 46 posts
Flag Post

Are you are saying it’s going to frame 2 of the movieclip rather then frame 2 of the stage?

Edit: Just tested it. It is doing frame 2 of the movie clip. That’s actually pretty cool.
I could use that to have a second set of buttons if I really wanted to. Mistakes can be fun.

 
avatar for NineFiveThree NineFiveThree 1370 posts
Flag Post

That methods are called on objects is one of the first things that you learn if you look into oop.
Knowing the basic (boring) things, saves you a lot of time, because you know what you are doing.
(if you just copy snippets, you will never understand what they are doing)

Frames are for animations, nothing else.

 
avatar for Tanst Tanst 46 posts
Flag Post

panetest.goto2.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_7);

function fl_ClickToGoToAndStopAtFrame_7(event:MouseEvent):void
{
gotoAndStop(2);
}

It works! Thank you for the help. On a related note is there a good spot to read up on all of this stuff?

 
avatar for Tanst Tanst 46 posts
Flag Post

Oh I’ve done object oriented programing before but I’m new at AS3 and flash. It’s simmlar to things I’ve done in the past but still different.

 
avatar for NineFiveThree NineFiveThree 1370 posts
Flag Post
Originally posted by Tanst:

Oh I’ve done object oriented programing before but I’m new at AS3 and flash. It’s simmlar to things I’ve done in the past but still different.

That’s because you have the graphical user interface that clutters everything. MovieClips are objects.
As3 is quite similar to Java.
If you want to start programming, stop using the Flash IDE and use some code editor.
Maybe you can even use one that you have used before.

Originally posted by Tanst:

On a related note is there a good spot to read up on all of this stuff?

I never worked with components nor do I use the Flash IDE.
Learning what components are available, how to use them, how to use everything, how to … is a matter of hitting F1.
Or use the online version of the help.

Then there are online tutorials:
some videos from adobe to get started with as3 in the Flash IDE
THE actionscript book
entertaining, yet decent tutorials
general actionscript

 
avatar for Draco18s Draco18s 6860 posts
Flag Post
Originally posted by Tanst:

That’s actually pretty cool.

It’s also expected behavior >..>

 
avatar for Tanst Tanst 46 posts
Flag Post

Thanks again NineFiveThree.