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:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* 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
Go Back   Tech Support Forum > Design Forum > Web Design & Programming
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read

Web Design & Programming Discussion of web design, and server-side & client-side scripting

Reply
 
Thread Tools
Old 07-29-2008, 05:31 PM   #1 (permalink)
Registered User
 
Join Date: Jun 2008
Posts: 15
OS: XP SP3


Arrow Flash Movie to Scale to Browser

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?
Sem_White is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-29-2008, 06:26 PM   #2 (permalink)
Design Team Member
 
jamiemac2005's Avatar
 
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">
That's just an annoyance fix (incase you hadn't done it already).

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
Now to the intelligent way:
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";
That stops the flash file from scaling.

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 know my notation and examples may be hard to understand so if you need me to clarify on anything then please do post saying so.. i do also have examples of this in flash files that i can upload if you'd like.

I hope i make some sence.

Cheers,
Jamey
__________________

Help fight cancer. < I just started =]
jamiemac2005 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-30-2008, 09:15 AM   #3 (permalink)
Registered User
 
Join Date: Jun 2008
Posts: 15
OS: XP SP3


Re: Flash Movie to Scale to Browser

Thanks I am going to put this into practice. Be back to you later.
Sem_White is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-30-2008, 09:18 AM   #4 (permalink)
Design Team Member
 
jamiemac2005's Avatar
 
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

Hope it works.

Cheers,
Jamey
__________________

Help fight cancer. < I just started =]
jamiemac2005 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-30-2008, 01:03 PM   #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.
Sem_White is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-30-2008, 01:25 PM   #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?
Sem_White is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-30-2008, 02:17 PM   #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....?
Sem_White is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-30-2008, 02:18 PM   #8 (permalink)
Design Team Member
 
jamiemac2005's Avatar
 
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
__________________

Help fight cancer. < I just started =]
jamiemac2005 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-30-2008, 02:19 PM   #9 (permalink)
Design Team Member
 
jamiemac2005's Avatar
 
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?
__________________

Help fight cancer. < I just started =]
jamiemac2005 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-30-2008, 02:55 PM   #10 (permalink)
Registered User
 
Join Date: Jun 2008
Posts: 15
OS: XP SP3


Re: Flash Movie to Scale to Browser

Ok. Most importantly it is scaling, just not to the full degree on monitor.
Right take a look
semiotically.com
semiotically.com/semi12.fla
Sem_White is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-30-2008, 02:56 PM   #11 (permalink)
Registered User
 
Join Date: Jun 2008
Posts: 15
OS: XP SP3


Re: Flash Movie to Scale to Browser

it is the objects in flash
Sem_White is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-30-2008, 03:24 PM   #12 (permalink)
Design Team Member
 
jamiemac2005's Avatar
 
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

Okay, i'll take a look and get back to you in a few.

Cheers,
Jamey
__________________

Help fight cancer. < I just started =]
jamiemac2005 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
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

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



All times are GMT -7. The time now is 04:05 PM.



Copyright 2001 - 2008, Tech Support Forum

Search Engine Friendly URLs by vBSEO

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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82