![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Web Design & Programming Discussion of web design, and server-side & client-side scripting |
![]() |
|
|
Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Jun 2008
Posts: 15
OS: XP SP3
|
Hi I have a little experience reading into xhtml and css and developed an ok understanding.
Kind of rushed head-first into flash. I wanted to create an website in the format of an online book. To do this used this software: page-flip.com When I publish my movie (using flash 8) it stays immobile centered in browser, when I would like it to adapt to the browser/ monitor size. I have changed the publish settings to percent in flash program itself. And also attempted the object, embed settings in the HTML code.. although some clarification on the correct code is necessary. How I can succeed in making the movie scale? |
|
|
|
|
|
#2 (permalink) |
|
Design Team Member
Join Date: Jul 2007
Location: Northampton, UK
Posts: 1,090
OS: Win Vista Home Premium & Ubuntu Hardy(8.04)
|
Re: Flash Movie to Scale to Browser
Hey, i've created full-browser flash sites before so i guess i can help.
First, when you publish in flash i assume that you're outputting as a website aswell? Theres a common problem in this in that flash inserts an annoying 10pxish border around your movie? To start with heres a basic fix for that: Code:
-Add the following to the body tag in the HTML file: topmargin="0" leftmargin="0" so it looks like <body...other stuff... topmargin="0" leftmargin="0"> Okay, you've changed the settings to output as a percentage so that doesn't need doing. Now in the actionscript: This depends on how you want your movie to scale. If you don't care about pixellation in your flash file (which i think you should [read on anyway])... you can use the following code to get your page to scale the un-intelligent way: Add it somewhere where it will run early (e.g. in the first frame at the top of your AS) Code:
Stage.scaleMode = "exactFit";//this will distort the flash though so i don't suggest it This relies on you being able to dynamically scale your objects within your flash file. - Add the following actionscript to your flash file: Code:
Stage.scaleMode = "noScale"; Next you need a handler for when the Stage's size changes: Code:
var stageHandler:Object = new Object();//sets up a listner
stageHandler.onResize = resizeStuff;//set up an event handler
Stage.addListener(stageHandler);//adds the listener to the stage
//write the function to handle re-sizing
function resizeStuff(){
//within this function resize all the stuff on the stage
//i used a movie clip for the background
//so as an example
background_mc._width=Stage.width;
background_mc._height=Stage.height;
//or as a cleverer way to do it
//you could define two global variables (newXScale, y aswell)
//and modify them values with the stage
//e.g:
newXScale = (Stage.width/500)*100;// 500 being the initial width of the movie
//and the same with height and y
// then ensure the xscale and yscale of each object is set correctly (literally scaling)
myPage_mc._xScale = newXScale;
//and the same for y
}
I hope i make some sence. Cheers, Jamey |
|
|
|
|
|
#5 (permalink) |
|
Registered User
Join Date: Jun 2008
Posts: 15
OS: XP SP3
|
Re: Flash Movie to Scale to Browser
I wasn't originally using the flash publshing to create a html file, in this case the very index.html, which was a good starting point.
I was pleased to see your advice working with: Stage.scaleMode = "exactFit"; Still it did male me laugh when I saw the scaling. So far so good. Thanks, will now attempt the more detailed code, will let you know the scaling results then. I think afterwards if all scales appropriately, I will start using a standard index page and inserting the flash movie to scale to a percentage of window within the index file as I like the presentation aspects of css and standard xhtml. i.e. to complement the surroundings of the flash movie. I also set up the same query at: http://www.designerstalk.com/forums/...e-browser.html Urban1977 started talking about how to achieve full-screen using buttons... similar to the idea of flash within html page... I followed the link to ffiles but was introduced to javascript, again! so I hesitated experimenting further. Anyway will again update on the progress. |
|
|
|
|
|
#6 (permalink) |
|
Registered User
Join Date: Jun 2008
Posts: 15
OS: XP SP3
|
Re: Flash Movie to Scale to Browser
Hi tried replacing the:
Stage.scaleMode = "exactFit"; with: Stage.scaleMode = "noScale"; var stageHandler:Object = new Object(); stageHandler.onResize = resizeStuff; Stage.addListener(stageHandler); function resizeStuff(){ background_mc._width=Stage.width; background_mc._height=Stage.height; } Received no syntax errors but movie content has now disappeared with just the flash background visible. Am I following the example correctly? |
|
|
|
|
|
#7 (permalink) |
|
Registered User
Join Date: Jun 2008
Posts: 15
OS: XP SP3
|
Re: Flash Movie to Scale to Browser
My mistake I missed the flash file.
It seems to be scaling. Just one issue left: On my laptop screen it fills the full-screen (11.1") On my TFT monitor (22") it doesn't, as if there is some limiting factor....? |
|
|
|
|
|
#8 (permalink) |
|
Design Team Member
Join Date: Jul 2007
Location: Northampton, UK
Posts: 1,090
OS: Win Vista Home Premium & Ubuntu Hardy(8.04)
|
Re: Flash Movie to Scale to Browser
Hmm, it's hard to debug flash without actually seeing what's going on... If you could upload the fla it would be easier to help. I don't know exactly what's going on, but the order of the movies may be messing up (if they're on the same layer it could be brought forwards) but it's really hard to think of what could be going on.
Cheers, Jamey |
|
|
|
|
|
#9 (permalink) |
|
Design Team Member
Join Date: Jul 2007
Location: Northampton, UK
Posts: 1,090
OS: Win Vista Home Premium & Ubuntu Hardy(8.04)
|
Re: Flash Movie to Scale to Browser
Ah okay, what exactly isn't filling the screen? is it the flash not filling the HTML or is it the objects in the flash file not filling the screen?
|
|
|
|
![]() |
| Thread Tools | |
|
|