views:

103

answers:

2

I am very new to ActionScript and Flash development so excuse any incorrect terminology that I may use. I'm just playing around in some spare time.

I'm developing on Ubuntu, using AS3, and compiling with the flex sdk using the ANT tasks (flexTasks-4.0.0.10485).

I am looking for a way to scroll content within a sprite. So, say I have a sprite that is 100px in height, and I add several child objects stacked on top of each other that exceed the sprite height, then I would like to display a scrollbar to enable scrolling through the children.

Now I found fl.controls.ScrollBar, but when I attempt to import the class I receive the error:

Error: Definition fl.controls:ScrollBar could not be found

I'm not sure why I am receiving this error, as this appears to be a valid AS 3 component according to the livedocs.

Is there something I am missing? Is there a scrollbar component in AS 3 that can be attached to a display container like a sprite?

Thanks

+1  A: 

In order to use the component you need to have it in the library. One way of adding it is:

Get Adobe Flash Professional and install it;(Wine may run (enough to get you going) CS3 by now)

Drag the ScrollBar component(from the components panel in your library)

Set Flash to generate a swc file (see File->Publish Settings->Flash);

Add this swc file to your library ( check flexTasks documentation on how to do this,basically you need to provide the path to it when doing the compile with FlexSDK );

In my opinion you're better off with a scroll class someone else created.

There is a tutorial here http://www.goflash.org/blog/tutorial-scrollbar-flash-as3/

The page is in Romanian but I'm sure you'll figure it out as the source code is posted (Download Source)

Hope it helps! Have fun!

Oliver
So basically the flash components are not included in the flex SDK, and need to be exported as an swc file.
Steve
Yes, for the components you need to use Flash (last time I've used those(Flash 8) had to be Professional version, maybe things changed since then) but you can also export them to a swc that can be used with FlexSDK
Oliver
A: 

I would recommend using this excellent scrollbar component: link

needto
I didn't ask about recommendations for other scrollbar components.
Steve