Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > JavaScript

Reply
 
LinkBack Thread Tools
Old February 27th, 2008, 04:36 PM   #1
Ola
New Member
 

Join Date: Feb 2008
Location: sweden
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Ola is on a distinguished road
Aligning scrollbars

Ok... I've been working on this flash site for my own where I've incorporated an introanimation done in After Effects. For this to look good I have chosen to make my flash 900*900 pixels large (which is kind of large I guess). The actual area that the website occupies is 800*400, so that's alright. However, when you first enter the website you would like to view from the middle of the site, and as you probably are thinking, you rarely use a browser window, as large/larger than, 900*900 pixels. It does not matter if the browserwindow actually crops the top and bottom of the flashfile, but since the flashfile is 900*900 it starts by croping only the bottom (if you use a smaller browserwindow) as it is now. The HTML file is setup so the flashfile is centered by using tables. It's no problem in scrolling down once you've entered the site, but I would instead like to use some kind of browserhints that tells the internetbrowser to scroll down so it positions itself in middle of the whole site, once you enter.

So... Is this possible with some javascript code or any other kind of script. Go to www.surfsonic.se/test3 and you'll see what I mean.
Ola is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old February 27th, 2008, 10:22 PM   #2
New Member
 

Join Date: Jul 2007
Location: Sydney
Age: 28
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 AndrewFelix is on a distinguished road
Re: Aligning scrollbars

WOW! Nice video!
This problem should be solved with a combination of actionscript and css:
First of all publish your movie at the size you think it occupies...so 800 x 400.

In the first frame of your flash add this actionscript:
Code:
 Stage.scaleMode = "noScale";
In your HTML container page set your body style to look like this:
Code:
<style type="text/css">
<!-- body { 
  height:100%;                             
  width:100%;                            
  margin:0;
} -->
</style>
Let me know if that helps
AndrewFelix is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old February 28th, 2008, 09:04 AM   #3
Ola
New Member
 

Join Date: Feb 2008
Location: sweden
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Ola is on a distinguished road
Re: Aligning scrollbars

Thanks for the input... Well, in the publish settings I already have the noscale thing enabled. What I maybe forgot to clearfy was that I intentionally published the swf as 900*900 so that the intro animation would look good... However, when the intro is over and you get to the actual website it only uses 800*400 of the actual published size. I guess most users (if you don't like me, uses a 15" with 1680*1050) use a browser window that is smaller than 900*900, hence the reason for the browser hints.

I did try the css thing, but it didn't do anything.
Ola is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old February 28th, 2008, 06:51 PM   #4
New Member
 

Join Date: Jul 2007
Location: Sydney
Age: 28
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 AndrewFelix is on a distinguished road
Re: Aligning scrollbars

What do you mean by 'look good'?
If you make the flash full screen, it won't matter how many pixels you publish at. Because it will automatically scale to the size of the browser. How good it looks will depend entirely on the users screen size. If the video is 900px high, it won't matter if you publish at 400px high, as long as the movie clip is centred.
Having said all that, I think you should post your problem on a flash forum. It's not really a JS issue that you have.
AndrewFelix is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old February 29th, 2008, 12:16 PM   #5
Ola
New Member
 

Join Date: Feb 2008
Location: sweden
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Ola is on a distinguished road
Re: Aligning scrollbars

Sorry I'm a little vauge in my description. The thing is that the introanimation is made in After Effects so it's pixelbased instead of vector graphics, imported in flash with the On2 VP6 codec. So I wouldn't like any scaling of the actual swf. Put short, when you enter the site, I would like some kind of command (whatever script languish that might be appropriate) to tell the browser to scroll down so the viewer window is centered above the swf in the html document.

I could place the whole intro thing in a smaller swf (like 800 by 400) but that would limit the whole animation cropping the whole thing making it look bad. I've tried this, compare: www.surfsonic.se/test2 and www.surfsonic.se/test3
In test2 you can clearly see the limitations of the swf size in the intro. It might be a minor thing for most people but it bugs me. This scroll thing would make it compatible with smaller low res monitors as well. I will lurk around at the flash forum to see if I can find what I'm looking for.
Ola is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
Problem with IE Scrollbars abis123 HTML, XHTML and CSS 1 October 13th, 2007 06:01 PM
how do i get scrollbars on resize huminuh83 Flash and ActionScript 0 April 4th, 2007 12:39 AM
Scrollbars in Firefox ChrisTheSoul HTML, XHTML and CSS 1 November 24th, 2006 11:38 AM
IE Overflow issue: not displaying scrollbars Yossarian HTML, XHTML and CSS 2 September 20th, 2006 04:42 PM
Custom scrollbars in JavaScript lozmawoz JavaScript 2 August 7th, 2006 11:25 AM


Search Engine Optimization by vBSEO 3.2.0 RC8