On Wed, 17 Nov 2004 15:13:21 GMT, "Keon" <jansen.koen@telenet.be>
[quoted text, click to view] wrote:
>Hello,
>
>Is it possible to include a html file in a flash file?
>
>I want to make a flash website but i want to use html file as textfields
>because the layout is easer to optimise in HTML then in flash.
>
>I use flash 5 to create my website.
>
>Can somewhone help me?
>
>greeting
>Koen
Flash supports a limited subset of HTML tags. You can use CSS to
optimise the HTML that's supported.
For an example of what's possible, check out my site that uses
external HTML files extensively.
http://www.bb-video.net/ The body of each tutorial is a different external HTML file (depends
on which page button you click).
One way to make a HTML page load from a Flash button using CSS for
formatting follows. The HTML pages need to be modified. DO NOT use the
head tags! Begin and end with just a <body> tag. As you can see, you
can make custom tags and call them anything you want. In the example
below the <M> tag stands for main body and <X1> for a sub heading. The
tags are nested just like in a regular HTML page and you must close
innner tages before starting, closoing outer tags.
Example partial HTML file:
<body><M><X1>My Web page</X1> more text here...</M></body>
Example partial external CSS file:
M{
color: #FFFFFF;
font-size: 14;
font-family: "Tahoma",Arial, Helvetica, sans-serif;
font-weight: normal;
margin-left: 6;
margin-right: 6;
display: block
}
X1 {
text-align:center;
color: #A09DA4;
font-family: sans-serif;
font-size: 18;
font-weight: bold;
display: block
}
...............................................................
The following is in ActionScript and would go on a page button
on (release) {
style_sheet = new
TextField.StyleSheet();
css_loc = "name of external style sheet.css";
xml_loc = "name of file.htm";
style_sheet.load(css_loc);
style_sheet.onLoad =
function(ok)
{
if(ok)
{
loadXML(xml_loc);
}
else
{
}
}
function loadXML(str)
{
var xml_loc = str;
myXML = new XML();
myXML.onLoad = function()
{
// create a Dynamic Text Field named myText_txt
// values below as follows: name,level, X, Y, width, height
temptext = myXML.firstChild;
createTextField("myText_txt",1, 24, 100, 500, 335);
// set features for newly created text field
myText_txt.multiline = true;
myText_txt.wordWrap = true;
myText_txt.html = true;
myText_txt.styleSheet = style_sheet;
myText_txt.htmlText = temptext;
}
myXML.load(xml_loc);
}
}