# It almost works! Dynamically loads html and formats with css

**URL:** <https://forum.kirupa.com/t/it-almost-works-dynamically-loads-html-and-formats-with-css/247634>\
**Category:** flash\
**Created:** [December 27, 2007, 3:59pm UTC](https://forum.kirupa.com/t/it-almost-works-dynamically-loads-html-and-formats-with-css/247634 "2007-12-27T15:59:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![loki131](https://avatars.discourse-cdn.com/v4/letter/l/839c29/32.png) [@loki131](https://forum.kirupa.com/u/loki131)\
**Post date:** [December 27, 2007, 3:59pm UTC](https://forum.kirupa.com/t/it-almost-works-dynamically-loads-html-and-formats-with-css/247634/1 "2007-12-27T15:59:57Z")

</div>

Ok this is my fist post so it’s possible I just missed this somewhere but I am dynamically loading html and formatting it with css. That works just fine no problems the issue is with links, I would like to open a new window but it gets killed by the pop up blocker! The issue I believe is that flash is rendering the html and not the browser so the browser isn’t seeing the interaction that triggered the target=”\_blank” and kills it. The next logical step is to just use some simple java but unfortunately that gets blocked to. I have tired pretty much everything I can think of and checked the tech notes, forums, and it seems no one has run into this problem. So I am hoping I just missed something obvious or there is a better way to load basic html into flash.

So here is the code:  
// Loads HTML and Applies CSS  
loadText = new LoadVars();  
loadText.onLoad = function()  
{  
\_root.HomeHTML.html = true;  
\_root.HomeHTML.htmlText = this.HomeText;  
}

var format = new TextField.StyleSheet();  
var path = “siteStyle.css”;

format.load(path);  
format.onLoad = function(loaded) {  
if (loaded) {  
HomeHTML.styleSheet = format;  
HomeHTML.text = loadText.load(“Home.htm”);  
} else {  
HomeHTML.text = “Error loading CSS file!”;  
}  
};

The Dynamic text box is named HomeHTML and I think the rest is self explanatory.  
If anyone has a solution it would be greatly appreciated!

Links:  
[http://www.jimhunkins.com/test/Main.htm](http://www.jimhunkins.com/test/Main.htm)  
[http://www.jimhunkins.com/test/siteStyle.css](http://www.jimhunkins.com/test/siteStyle.css)  
[http://www.jimhunkins.com/test/Home.htm](http://www.jimhunkins.com/test/Home.htm)  
(and yes I know my site is way out of date I’ve been busy!)

Thanks.
