15 Replies Latest reply on Jan 17, 2013 4:12 PM by kglad

    Add border around specific textfield copy?  Multiple paragraphs, one needs outlined

    Bit Crusher Level 1

      I have a textfield that is generated and populated via stylesheet + string.  The copy in the string is pretty lengthy and I have two paragraphs toward the end of the string that needs a black border.  Overall the different things I've tried to get some specific copy outlined doesn't work.  I can create a bit of a work around for getting the copy outlined, however it's positioned and since this is using HTML text the leading for the copy is based on the user's OS - so on a PC it is positioned fine, on a Mac, it's off by a great amount.

       

      import TextField.StyleSheet;

      var styles = new TextField.StyleSheet();

      styles.parseCSS(css);

      styles.setStyle("body", {fontFamily:'Arial,Helvetica,sans-serif', fontSize:'11px', color:'#000000'});

      styles.setStyle("h1",{fontFamily:'Arial,Helvetica,sans-serif', fontSize:'11px', color:'#7a68ae', fontWeight:'bold'});

      styles.setStyle("bbw",{fontFamily:'Arial,Helvetica,sans-serif', fontSize:'11px', color:'#000000', marginLeft:'8px', marginRight:'8px', fontWeight:'bold'});  // tried adding borderStyle here, no luck

      styles.setStyle("indent",{fontFamily:'Arial,Helvetica,sans-serif', fontSize:'11px', color:'#000000', marginLeft:'12'});

      styles.setStyle("li",{fontFamily:'Arial,Helvetica,sans-serif', fontSize:'11px', color:'#000000'});

      styles.setStyle("a",{fontFamily:'Arial,Helvetica,sans-serif', fontSize:'11px', color:'#2C65A9', textDecoration:'underline', fontWeight:'bold'});

       

       

      var copy:String = "Lorem ipsum dolor sit amet, elementum velit vel, urna facilisis amet, velit nec auctor debitis sit arcu, quis lectus, amet lacus arcu magna nec at aliquam. Posuere vel molestie vitae wisi. Felis pretium, sit sollicitudin lacus est id mauris, ut donec et elementum, justo et. Sit turpis in, urna malesuada consequat nunc malesuada nam. Praesent hendrerit erat. Fringilla iaculis lacinia convallis mattis erat mauris, tellus sapien purus accumsan pede amet at, mauris nunc nec magna sit eleifend, pede ultrices felis tincidunt. Magna tellus wisi, in nec lacinia voluptatem. Justo fringilla gravida ligula aute lacus metus. Quisque feugiat elit accumsan tincidunt quis, mauris nulla orci sapien metus convallis potenti, dignissim porta praesent commodo donec placerat."

       

      + "<br>Ut nascetur et non quam condimentum, vulputate tristique varius erat id nunc feugiat, eget fusce sed, eget dolor nonummy hymenaeos, viverra maecenas. Ullamcorper porttitor gravida nulla ornare ultrices, mauris convallis enim ultricies rhoncus quisque nunc, varius quisque interdum, aptent ornare rutrum, et quisque accumsan. Libero pede urna consectetuer non, luctus odio curabitur justo arcu quis suspendisse, pede ut vestibulum. Dui suspendisse fusce ad sit, tempora euismod nec, in eu interdum elit mauris vehicula amet, turpis consectetuer dolor augue praesent lorem. Wisi etiam scelerisque, consequat cillum sed magnis. Vitae in metus risus ipsum sed massa, tristique est hendrerit, lacus egestas enim etiam mauris, et aliquet faucibus montes neque vel hendrerit. Odio suscipit. Justo arcu lacinia cras, tellus sapien dolor molestie, arcu vestibulum, amet tristique tempor pulvinar nec, id cras vel."

       

      + "<br><bbw>Dolor donec, sapien habitasse libero ipsum sed, nulla sed consectetuer massa ut, augue erat felis lacus officia. Consectetuer cras sapien, fusce et at quis fusce orci rutrum, sapien sit, occaecat cum sagittis tincidunt lacinia felis, ante facilisis quam proin ipsum tellus. Nunc consequat malesuada in, eros dui leo. Adipiscing commodo mi, placerat sit praesent dolor adipisicing, et porttitor a eget eget sed, nulla malesuada quis lectus nam. Phasellus accumsan in quam maiores eu penatibus. Vivamus potenti nec luctus faucibus. Ipsum illum magna velit eget eu, fringilla dis pretium in augue vehicula vestibulum, pede rhoncus vitae consectetuer vel nunc pede. Lobortis imperdiet augue risus, velit tempor eu, voluptas nunc nulla vitae felis. Non lorem in magna tincidunt arcu id, sed ipsum eu purus ultricies faucibus, ut fermentum dictum in cras in, risus vestibulum a neque quam. Aliquam bibendum eu proin elit cursus, per bibendum. Mauris sapien sit adipiscing non sit molestie, augue quis, sit mauris eros wisi, nibh dolor, sit proin sed sit eum.</bbw>"

       

      + "<br>Mauris tortor vestibulum phasellus malesuada quam neque, a consectetuer ante nulla eget sed est, nihil in congue proin lectus rhoncus praesentium. Fringilla malesuada imperdiet phasellus urna integer. Volutpat et justo adipiscing proin, enim cras suspendisse elementum, at aliquam similique hymenaeos donec phasellus, lorem dui gravida tempor, magna ante sed libero dui. Semper quis justo, platea libero. Id pellentesque donec varius interdum neque, sed sapien vel cubilia, nostra fermentum dictumst cum dui vitae nunc, risus nunc urna eu, suscipit urna adipiscing error lorem ut commodo. Nec eget consequat, maecenas at, quis rerum, faucibus tempus hendrerit duis. Tortor dictum nulla dictumst eros doloribus commodo. Eros volutpat nullam mauris justo, auctor mus, ut et, ipsum at arcu lectus convallis turpis sollicitudin. Quam eu vel, sed curabitur, et eget in aliquam. Vestibulum lectus, mi nec, gravida mauris proin libero, sit justo convallis voluptates ligula ridiculus.";

       

      copyLoad();

       

      function copyLoad(){

                var copyContent:TextField = isiMC.scroll_content.createTextField("copyContent", this.getNextHighestDepth(), 0, 0, 260, 20);

        copy_holder.copyContent.multiline = true;

                copy_holder.copyContent.selectable = false;

                copy_holder.copyContent.wordWrap = true;

                copy_holder.copyContent.styleSheet = styles;

                //isiMC.scroll_content.copyContent.border=true;

        copy_holder.copyContent.html = true;

                copy_holder.copyContent.htmlText = isi;

                copy_holder.copyContent.autoSize=true;

                copy_holder.copyContent.antiAliasType = "advanced";

        copy_holder.copyContent.gridFitType = "pixel";

                copy_holder.copyContent.sharpness = 800;

      };

       

       

      so there's no problem with this working, however the third paragraph (for example) using <bbw></bbw> needs a black outline around the paragraph.  copyContent has the option for receiving a border, but there doesn't seem to be a way of adding in a style for a border.  Not certain if there's a way to concatenate this so that I could have, say, three textFields (no border + border + no border for the last paragraph)

       

       

      any tips, suggestions or solutions would be greatly appreciated!