Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Flash (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 23rd, 2004, 02:45 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default dynamic text box

Can somebody hep me figure this out. I am creating a text box with actionscript,the width needs to be the 323, but the height to be dynamic. My reason for doing this is that I am going to make this a scrolling text box and I will probably have different amounts of text load into here at different times. Another weird thing is that is seems like my text box is cramming as much text as it can inside it, therefor ignoring my font size.


var externalData:LoadVars = new LoadVars();
externalData.load("bio.txt");

this.createTextField("bio_txt", this.getNextHighestDepth(), 12, 31, 323, 800);
externalData.onLoad = function() {
    bio_txt.text = externalData.bioText;
}
bio_txt.autoSize = false;
bio_txt.border = true;
bio_txt.borderColor = 0x00FF00;
bio_txt.multiline = true;
bio_txt.selectable = false;
bio_txt.wordWrap = true;

var my_fmt:TextFormat = new TextFormat();
my_fmt.font = "Arial"
my_fmt.size = 15
bio_txt.setTextFormat(my_fmt);

Thanks In Advance
Peace
Mike
__________________
Peace
Mike
http://www.eclecticpixel.com
 
Old November 24th, 2004, 03:02 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 451
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ben Horne
Default

You may want to try asking this at Flash Kit. There's bound to be someone there that can help you.


Sorry I couldn't help any,



Ben Horne
-------------------------
I don't want to sound like I haven't made any mistakes. I'm confident I have.

Most likely using FireFox and concocting my next Macromedia Flash project
Snibworks Forums Moderator

Welcome to the New Age
 
Old November 24th, 2004, 09:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I figured it out, I had to make a few adjustments though. One thing that I could hardly find anything on was when using a mask with the createTextField you have to embed the font by copying it into your library. Then attach it on export. you can see it in action at
http://www.snakeshakers.com/snakeshakers_mv.html


var externalData:LoadVars = new LoadVars();
externalData.load("bio.txt");

this.createTextField("bio_txt", this.getNextHighestDepth(), 12, 31, 323, 20);
externalData.onLoad = function() {
    bio_txt.text = externalData.bioText;
}
with(bio_txt){
    embedFonts=true;
    type = "dynamic";
    autoSize = true;
    border = false;
    borderColor = 0x00FF00;
    multiline = true;
    selectable = false;
    wordWrap = true;

}

var my_fmt:TextFormat = new TextFormat();
with(my_fmt){
    font = "SnakeArial";
    size = 12;
}
bio_txt.setNewTextFormat(my_fmt);

Peace
Mike





Similar Threads
Thread Thread Starter Forum Replies Last Post
Grab Values From List Box into Text Box phungleon VB How-To 2 June 19th, 2008 10:33 PM
Count in combo box(display results in text box) mboyisis Access 4 April 4th, 2008 07:08 AM
Can't set text property of dynamic text box sreerajrs ASP.NET 1.0 and 1.1 Professional 1 May 31st, 2006 09:39 PM
Extract text from text file & put in dropdown box tsukey Beginning PHP 5 July 20th, 2004 09:49 PM
Search using drop down list box and a text box tcasp Classic ASP Basics 1 July 31st, 2003 02:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.