|
|
|
Home Help documents Embed or inserting flash file
|
Embed or inserting flash file |
| |
Click the thumbnail to in large the screen shot
The easiest way to embed a flash movie into any web page is from
flash application itself.
After creating a Flash movie choose File > Save As from the top
menu to save your movie.
Save the file as "any.fla". |
| |
Under File > public setting , click formats tab check
the swf and html and hit publish.
Flash will create html page at the same folder as your original FLA (Flash source code).
You can rename the html to anything you'd like but it's usually called index.html |
Go to the folder where you save your FLA, you will find swf file and index.html
open your index.html inbetween <body></body> tags you will see the code below
|
| |
The code consist Object and Embed.
if you look at the code closely, basically they are the same thing.
The Object part is used by Microsoft's Internet Explorer and the Embed
part is used by others.
These two parameters are the most important part.
<param name="movie" value="any.swf" />
< embed src="any.swf",...
This code tell us the location of the movie relation to your html page.
Your swf is in the same folder as your index.html
Make sure these two have the same value.
If the swf file is in another directory, say you want to put it
in "flash" folder, the code needs to change
to
<param name="movie" value="flash/any.swf"
/>
< embed src="flash/any.swf",...
The above code is a relative path, it tells you the position of your
swf in relationship to your index.html
Absolute path will be http://www.yourserver.com/flash/any.swf
- There are many other parameter settings that control your swf,to find out go to the
adobe website.
Here are the most common parameters
<param name="allowScriptAccess" value="sameDomain"
/>
<param name="quality" value="high" /> the
rendering quality of the swf. (low,medium,high.
<param name="bgcolor" value="#666666" /> a
hexadecimal value of the swf background color.
<param name="wmode" value="transparent"> set
the background of the swf transparent or not.
The width and height parameters by default are set in pixels, but they can
also be entered as a percentage.
example: width="100%".
This means you're setting your swf 100% to the width of the browser, allowing the user
to see what is outside the actual size of your flash file.
Commonly among flash designers and developers the area where you design the page ia known as the "stage"
Here's an example of a flash slide show,
600x600 pixels flash movie on white background and I changed the parameters.
- This
is 600 pixel x600 pixels flash slide show,
I changed the width to 100% and make the html background the same color
if you right-click your mouse everything will be a flash file
For the example above the actual size of the flash file the width="600"
height="600" ( no px after the value), by changing the setting
to 100% doesn't mean your stretching the swf movie.
You should not stretch or shrink your swf because if the swf
use jpg images, and the picture will be pixelated.
Well I hope this article will give you a little understanding about how
to embed a flash file onto a html page. |
|
|