Welcome to Dream.In.Code
Getting Help is Easy!

Join 84,997 Programmers. There are 1,379 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

resizing/scaling flash movies based on resolution

 
Reply to this topicStart new topic

resizing/scaling flash movies based on resolution

jeffmc21
post 27 Nov, 2007 - 08:22 PM
Post #1


New DIC Head

*
Joined: 27 Nov, 2007
Posts: 17



My question is two-fold. Is there a way to detect a user's screen resolution and automatically have the flash movie scale to fit the resolution so that there are no scrollbars?

And two, I notice when I insert my flash movie into an HTML page for publishing on the web, the movie is 1)not centered and 2) there is a "border" of dead space around the movie. The movie doesn't cover the entire space of the html page, regardless of what the dimensions of the movie are.

Any help is greatly appreciated. And if I need to supply more info, just let me know what info you need.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


DilutedImage
post 27 Nov, 2007 - 08:58 PM
Post #2


DIC Addict

Group Icon
Joined: 20 Nov, 2006
Posts: 583

Try a search; there's TONS of information on those topics.


Are you using ActionScript 2 or 3?

When you ask about "screen resolution" are you truly wanting to go into full screen mode, or full window?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

jeffmc21
post 28 Nov, 2007 - 12:12 PM
Post #3


New DIC Head

*
Joined: 27 Nov, 2007
Posts: 17

QUOTE(DilutedImage @ 27 Nov, 2007 - 08:58 PM) *

Try a search; there's TONS of information on those topics.


Are you using ActionScript 2 or 3?

When you ask about "screen resolution" are you truly wanting to go into full screen mode, or full window?

I'm using Actionscript 2 I think. I'm not very versed in either, I can use the Script Assist enough to survive in Flash Pro 8.

I mean full window, I guess. Assuming the user has their browser window maximized, I would love for the flash movie to resize to fit that full window based on the user's screen resolution.

The #1 main issue that I would love to find a resolve to would be the "border" around my flash movie on an html webpage. It means that the background of the flash doesn't cover the whole page and leaves a white (or html background color) border around the movie.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

DilutedImage
post 28 Nov, 2007 - 01:17 PM
Post #4


DIC Addict

Group Icon
Joined: 20 Nov, 2006
Posts: 583

QUOTE(jeffmc21 @ 28 Nov, 2007 - 12:12 PM) *
The #1 main issue that I would love to find a resolve to would be the "border" around my flash movie on an html webpage. It means that the background of the flash doesn't cover the whole page and leaves a white (or html background color) border around the movie.


Set the BODY margin to 0px within your HTML file:
CODE
<body style="margin:0px;">



As for making the flash piece scale to fit the window, simply set the SWF's width and height to "100%" where it's been embedded in the HTML file.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

jeffmc21
post 28 Nov, 2007 - 01:21 PM
Post #5


New DIC Head

*
Joined: 27 Nov, 2007
Posts: 17

QUOTE(DilutedImage @ 28 Nov, 2007 - 01:17 PM) *

QUOTE(jeffmc21 @ 28 Nov, 2007 - 12:12 PM) *
The #1 main issue that I would love to find a resolve to would be the "border" around my flash movie on an html webpage. It means that the background of the flash doesn't cover the whole page and leaves a white (or html background color) border around the movie.


Set the BODY margin to 0px within your HTML file:
CODE
<body style="margin:0px;">



As for making the flash piece scale to fit the window, simply set the SWF's width and height to "100%" where it's been embedded in the HTML file.


Yeah, I had performed the search you mentioned earlier, and had found that "fix", however, it doesn't work for me. I inserted it into the html and the border is still there. I also tried using a table at 100% and the border is still there...especially on the left and right sides. The flash movie is built on a stage of 800x600, but my screen is 1024x768.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

DilutedImage
post 28 Nov, 2007 - 02:53 PM
Post #6


DIC Addict

Group Icon
Joined: 20 Nov, 2006
Posts: 583

Can you post a link then, so that I can see what you're talking about?

p.s. Are you wanting the aspect ratio of the Flash piece to change as well?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

jeffmc21
post 28 Nov, 2007 - 05:03 PM
Post #7


New DIC Head

*
Joined: 27 Nov, 2007
Posts: 17

Here's a link to a testing site I use. You can look at Example 1 under Pro-Tec Security to see the most clear example of what I am talking about. The examples under Collegewalk also have the problem, but are hidden because of the use of the same background color in the HTML. I am wanting to use a background image in both instances. I would want it to be visible behind the content areas of both flash sites.

http://sitetesting.jlmresources.com/


Thanks for all your help and time.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

DilutedImage
post 28 Nov, 2007 - 05:17 PM
Post #8


DIC Addict

Group Icon
Joined: 20 Nov, 2006
Posts: 583

If I'm understanding you correctly, you're wanting the gray portion to disappear?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

DilutedImage
post 28 Nov, 2007 - 05:27 PM
Post #9


DIC Addict

Group Icon
Joined: 20 Nov, 2006
Posts: 583

If that's the case, then you'll need to add the "wmode" parameter to your HTML. For example:

CODE
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="800" height="800">
    <param name="movie" value="protec1_2.swf" />
    <param name="quality" value="high" />
    <param name="wmode" value="transparent" />
    <embed src="protec1_2.swf" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="800" height="800"></embed>
</object>



EDIT:

I was just looking at the Publish Settings, and I think I found the perfect setting for what you're looking for. Under the HTML tab, set the "Window Mode" property to "Transparent Windowless".

That will make the Flash consume the entire window, and have a transparent background. You could then modify the HTML to use whatever background image you'd like.

This post has been edited by DilutedImage: 28 Nov, 2007 - 05:27 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

jeffmc21
post 28 Nov, 2007 - 10:56 PM
Post #10


New DIC Head

*
Joined: 27 Nov, 2007
Posts: 17

icon_up.gif icon_up.gif You, my friend, are now on my list of heroes!! I used the extra parameter in the code and it worked perfectly. I greatly appreciate the help you provided. biggrin.gif
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

DilutedImage
post 29 Nov, 2007 - 12:50 AM
Post #11


DIC Addict

Group Icon
Joined: 20 Nov, 2006
Posts: 583

Glad I could help. smile.gif
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

nfordham
post 15 Jan, 2008 - 02:30 PM
Post #12


New DIC Head

*
Joined: 15 Jan, 2008
Posts: 1

Dude, you ROCK!!! 3 Yrs. I too look at you as a hero!!!!!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/10/08 11:31AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month