Search  

HORIZONTAL SCROLLING CONTENT

HomeBrowse CategoriesFlashMenus & ButtonsHorizontal MenusHorizontal scrolling content

This is a simple way to scroll dynamic content (with a scrollbar). For this example 40 boxes are created and put on the stage.

This file even works when you are resizing the window! All the steps are welldocumented. The scrolling is performance optimized. The speed of the scroll can be easily changed, so can the number of boxes and the layout of the scrollbar(width, graphics etc.). They are all AS2 variables.

Have fun :-)

UPDATE JULY 2008 : A similar effect is also used in my xml gallery file – see more here: http://flashden.net/item/xml-gallery/13612

Posted 7 months ago

I can only see 5 boxes 0-4 no scroll bar, using mac/safari

Posted 7 months ago

wow after i posted the scroll bar popped up, very good!

Posted 7 months ago

please, I know that my question is stupid, but what is the code to make or show a content? loadMovie for example ?... Each box is one frame ? Thanks

Posted 7 months ago

Same for me. I had to reload to see the scroller. Nice file.

Posted 7 months ago

Please, why when I write this, I have always the repeat from the same image and not scroller ? Thanks.

//You could also load pictures into the boxes and use this for a gallery! //loadMovie(“myPicture.jpg”, mc); loadMovie(“myPicture1.jpg”, mc); loadMovie(“myPicture2.jpg”, mc); loadMovie(“myPicture3.jpg”, mc); loadMovie(“myPicture4.jpg”, mc); loadMovie(“myPicture5.jpg”, mc); }

Posted 7 months ago

Weird about the scroller not showing up, there’s a preloader in the file!

Anyways, the code is quite simple, but this is just one of the smaller problems that we (flash designers) often spend way too much figuring out how to solve, so I thought it would be nice to have.

Actually it was supposed to open as a new window, so the resizing could be tested, but Flashden didn’t get that one ;-) But it works…don’t worry!

To Victor: The code to show content? There isn’t really any special code for that. This file creates a holder for the boxes, and then (in a “for” loop) 40 movieclips containing a black box are attached (attachMovie). It’s as simple as that, check the file to see it. You can use loadMovie to load images into the boxes if you wish (though I would prefer a moveicliploader for that, it gives you better control). In the case you mention in your last post, the loadMovie is inside the loop – meaning that the same image/images are loaded each time. Instead you could create an array with 40 images (for instance: myArray:Array = Array(“img1.jpg!, “img2.jpg”...) ) make sure to create the array outside the loop, so you can approach it from elsewhere. Then you can write this in the loop: – loadMovie(myArray[i], mc); - In your example above, you are loading 6 images into each box, and they overwrite each other. Just replace all the loadMovie’s with this is line.

Hope you can understand, otherwise take a look at how loops work.

Posted 7 months ago

Thanks, but I do not know it, you kind enough to get an example that works with ten images ? Thanks. jmarc2006@orange.fr

Posted 7 months ago

hi. Can you help me to link an xml (that contain data) to the flash project. I have write down some lines (first time when i program in flash) but it lodes the data only after he create the boxes. Please help me. zos18@yahoo.com. 10x

Posted 7 months ago

Hi just would like to know if this can be display in full window mode and the images resized?

Thanks

Posted 7 months ago

Yes it works no matter what screen size it is. You can make the size of the thumbs(boxes) as you wish.

Posted 7 months ago

hi. i bought the item thinking you could shrink it and can’t figure out how to do so. i wanted to save it as a movie clip and resize it to fit in an 800 px high space but it won’t work when i make a mc of it. in fact, it doesn’t work at all when i put it into the project i’m working on. also, i’m really unclear how to put thumbs inside the boxes. any help?

Posted 7 months ago

ok. i got it to slide in my project but when i click on the bar, it jumps to the top of the screen instead of staying where i left it. again, is there any way to contain the slider within an 800×100 space? thanks

Posted 7 months ago

hi, Iliketoplay. Regarding the problem with the xml… can u help me? or can you tel me how to add link to the buttons? Please ansver me as soon as posible. Thank you. Ovidius. (e-mail zos18@yahoo.com)

Posted 7 months ago

To add links to the button, take a look at the onRelease function and the getURL function. The xml parsing is a rather large thing, so I can’t “just” explain that here!

Posted 7 months ago

Just bought file. I want to replace the black boxes with my own jpeg images. Can you tell me step by step how to do this?

Posted 7 months ago

Inisde the loop creating the boxes, you just put a loadMovie(“myPicture.jpg”, target), that will load a picture – though to load different pictures I suggest you store the pictures in an array (try chekcing the Flash documentation about arrays).

Posted 7 months ago

Could you give me an example of the array code with at least 2 images? I will then create the images and place in library to test. Think I will be able to take from there. Thanks so much.

Posted 7 months ago

yes i agree with drattray. can you send me that info as well?

uni_designs00@yahoo.com

Posted 6 months ago

Sorry but it’s not included in the file, and I haven’t got the oppertunity to edit the file at this moment, because it’s on another computer.

But basically you can store the name of your image files in an array like this:

var myPics:Array = new Array(“pic1.jpg”, “pic2.jpg”, “pic3.jpg”;);

This is an example of how to load them in a loop (into a movieclip with the instance name of “box_1”, “box_2” etc:

for(var i:Number = 0; i < myPics.length; i++){ loadMovie(myPics[i], this[“box_” + i]; }

It is acttually pretty simple, if you don’t figure it out, just highlight Array in Flash and hit F1, the documentation explains it better than I do!

Posted 6 months ago

can it load swfs?

Posted 5 months ago

Yes, but it’s not in the code right now. You have to add some loadMovie etc.

Posted 5 months ago

This is great! But is there any way of having the boxes constantly scrolling to the left? then going back to number 1?

Posted 3 months ago

i’m trying to make the boxes bigger with images in them and i’m not sure how to do that. because there is only 1 thing in the library, so i’m sort of confused how you even created this.

Posted 3 months ago

The boxes are created in a loop – so to add images put a loadMovie in there.

Posted 3 months ago

iliketoplay, Is scrolling not an option with this?

Posted 3 months ago

also, what about images of different sizes?

Posted 3 months ago

Not sure what you mean with “Is scrolling not an option with this” ! Right now as I remember it creates the boxes (attachMovie) in a loop – so different sized images may require some adjustment in the code – the file is just meant as a help for scrolling horizontally in general.

Posted 3 months ago