This is a discussion on "Centering an image within a scrollpane" within the Flash & Multimedia Forum section. This forum, and the thread "Centering an image within a scrollpane are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Centering an image within a scrollpane
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Centering an image within a scrollpane
If I have an image that gets loaded externally into a scrollpane, how do I center it horizontally? I have set the size of the scrollpane to a certain width, but if the image is less than this width, I would like it to be centered in the scrollpane instead of just being justified left.
Does anyone know how to do this? |
|
|
|
||||
|
Re: Centering an image within a scrollpane
do you have it working online ?
if you show us maybe we can help you !
__________________
Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
|
|
|||
|
Re: Centering an image within a scrollpane
go to http://www.momdadsquad.com and upload an image. You will see that the image is slightly offset to the left because the scrollpane is wider than the image. I would like this image to be centered in the scrollpane.
Right now the images that people upload can be any size so i made the scrollpane wide enough for any reasonably ratio-ed image. The images are handled by PHP which crops the width based on a 75 pixel height. So the height is always the same, but the width is variable. Do you understand what I mean? |
|
||||
|
Re: Centering an image within a scrollpane
I think the best way is to get the stage width and height by actionscript, divide them by 2 to get the center of the stage, then you can put your image on center of stage
Also you need to get your image width and height by actionscript too.
__________________
Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
|
|
|||
|
Re: Centering an image within a scrollpane
thanks for your help. that wasn't really the situation that I was in, but you gave me the idea to create an empty movieclip and load the image into it, then place the image in the apparel's width divided by two, subtracting its own width divided by two. It's all working now, thanks.
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Centering an image with CSS without moving anything else on the page. | Ed | Web Page Design | 5 | Oct 29th, 2007 11:34 |
| Centering an image on my web page | Fysicus | Web Page Design | 8 | Sep 21st, 2007 12:43 |
| centering help please | RZX Developer | Web Page Design | 7 | Aug 2nd, 2007 11:58 |
| Scrollpane Cutting Off Content | tox0tes | Flash & Multimedia Forum | 4 | Jan 26th, 2007 19:50 |
| scrollpane problem | tigas langaw | Flash & Multimedia Forum | 1 | Aug 5th, 2005 10:21 |