7 Replies Latest reply on May 15, 2008 6:31 AM by The Feldkircher

    Help with an HTML file in Flash.

    VanessaR14
      Hi there.

      I'm attempting to import an html file into my flash document into a textfield on a movie clip. The text works fine, as does the css I have attached, but the <a> tag will not work. I've attached my Actionscript and HTML files in the hopes that someone will be able to give me a hand! Thanks in advance.

      ~Vanessa

      Hi, here is my ActionScript code:

      function addArticle(sLinkage:String):Void{
      if(oOpenedArticle[sLinkage]!=undefined) {
      oOpenedArticle[sLinkage].swapDepths(nTopDepth);
      return;

      }
      }

      function loadArticle():Void {
      var nWidth:Number = mcDisplayBackground2._width;
      var nHeight:Number = mcDisplayBackground2._height;
      var nX:Number = mcDisplayBackground2._x;
      var nY:Number = mcDisplayBackground2._y;
      this.createTextField("tArticle", this.getNextHighestDepth(), nX, nY, nWidth, nHeight);
      tArticle.multiline = true;
      tArticle.wordWrap = true;
      tArticle.textColor = 0x000000;
      tArticle.html = true;
      tArticle.condenseWhite = true;

      }



      function loadData():Void {
      var lvArticleContent:LoadVars = new LoadVars();
      lvArticleContent.onData = function(sHTMLData:String):Void {
      tArticle.htmlText = sHTMLData;
      };
      var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
      cssStyles.onLoad = function():Void {
      tArticle.styleSheet = this;
      lvArticleContent.load("about.html");
      };
      cssStyles.load("aof.css");
      }



      var nTopDepth:Number;
      var oOpenedArticle:Object = new Object();
      mcAboutButton.onRelease = function():Void {
      loadData();

      gotoAndPlay(20);

      };


      loadArticle();





      And my HTML:

      <html>
      <head>
      <link href="aof.css" rel="stylesheet" type="text/css">
      </head>
      <body bgcolor="#666666">


      <p class="bodystyle" align="top" valign="top">

      <font color="#000000" face="Verdana, Arial, Helvetica, sans-serif">
      <br />
      <center>
      <h2>CONSULTATIONS</h2>
      <font color="#000000" size="-1">

      Click <a href="tutorials.html">here</a> for a tutorial.
      </p>
      </body>
      </html>