| Author |
Load Movie Command and Movie Scale Settings
|
|
| NBrice 2004-03-30, 9:08 pm |
| Hello there, I have a background image in my flash movie that needs to expand
to fit the browser window. However, when I change the publish settings to
'Exact Fit', the text and graphics on top of the background stretch to fit. I
tried separating the background out as a separate movie and added a 'load
movie' action to the first frame to load the contents, but the new movie
inherits the scale setting of the parent movie. Is there a way to set the
pixels dimensions of the loaded movie?
| |
| creativity06 2004-03-30, 9:08 pm |
| See if this helps. This tutorial is on Maximizing your Flash Movie into the browser.
[L=Maximizing Flash Browser]http://www.kirupa.com/developer/flash5/fullscreen.htm[/L]
| |
| NBrice 2004-03-30, 9:08 pm |
| Thanks, for the tutorial link, but I know how to maximise the Flash movie for
the browser. I need to do this for the background of the movie, but not for
the externally loaded swf files that load into a dropzone over the background.
Unfortunately the dropzone scales to exact fit aswell.
| |
| Ed Massey 2004-03-30, 9:09 pm |
| Put the image into a movie clip and tween the expansion manually in the
timeline, or using actionScript.
| |
| Ed Massey 2004-03-30, 9:09 pm |
| Here's how to do it with actionscript:
create a new movieClip (MC) and drag your image into the MC.
give the MC an instance name eg: backgroundImage, in the properties box
Centre the image in the MC so the MC registration point is central.
Centre the MC to the stage.
In the first frame of the backgroundImage MC add the following code:
////////////////////////////////////////////////////////////////////////////
/////////////////////////////
grow = function(){
widthMax=800;// change this to the width of the movie
heightMax=500;// change this to the height of the movie
increment=10;//expand the width&height by 10 pixels each cycle
_width+=increment;
_height+=increment;
if(_width>=widthMax){
_width=widthMax;
}
if(_height>=heightMax){
_height=heightMax;
}
if(_height>=heightMax&&_width>=widthMax){
clearInterval(growStart); // stop the function repeating once the
desired width and height are reached.
}
}
growStart = setInterval(grow,60);//setInterval(functionName,repeat interval)
////////////////////////////////////////////////////////////////////////////
/////////////////////////////
you could change the grow function to have accelerated growth by using the
following instead of _width+=... & height+=...
increment = 1.7;// smaller values will expand faster
_width+=(widthMax-_width)/increment;
_height+=(widthMax-_height)/increment;
hth,
Ed
|
|
|
|
| Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |