Centering an image within a scrollpane

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.



Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Dec 25th, 2007, 06:40
Reputable Member
Join Date: Jan 2004
Location: California
Age: 19
Posts: 209
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to tox0tes
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?
Reply With Quote

  #2 (permalink)  
Old Dec 25th, 2007, 17:16
marSoul's Avatar
Moderator
Join Date: Sep 2007
Location: Tehran - Iran
Age: 28
Posts: 398
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 4 Posts
Send a message via MSN to marSoul Send a message via Yahoo to marSoul
Re: Centering an image within a scrollpane

do you have it working online ?
if you show us maybe we can help you !
__________________
Designing For Communicating
Website : http://www.datisdesign.com
Weblog : http://blog.datisdesign.com

Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
Reply With Quote
  #3 (permalink)  
Old Dec 25th, 2007, 18:03
Reputable Member
Join Date: Jan 2004
Location: California
Age: 19
Posts: 209
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to tox0tes
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?
Reply With Quote
  #4 (permalink)  
Old Dec 25th, 2007, 18:25
marSoul's Avatar
Moderator
Join Date: Sep 2007
Location: Tehran - Iran
Age: 28
Posts: 398
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 4 Posts
Send a message via MSN to marSoul Send a message via Yahoo to marSoul
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.
__________________
Designing For Communicating
Website : http://www.datisdesign.com
Weblog : http://blog.datisdesign.com

Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
Reply With Quote
  #5 (permalink)  
Old Dec 26th, 2007, 06:00
Reputable Member
Join Date: Jan 2004
Location: California
Age: 19
Posts: 209
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to tox0tes
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.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 12:03.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43