Page 1 of 3 123 LastLast
Results 1 to 10 of 29

Thread: varible w,h Dynamic Text

  1. #1
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default varible w,h Dynamic Text

    Is there a way to have a dynamic text fields height be set exactly to what the content inside it is. I have a code that scrolls threw a movie file from the top to the bottom of the contents of the file. So I want to put the dynamic text field in the movie file and have it only be scrollable till the bottom. There are 5 buttons each will be loading in different content in that text field(at different times)?

    Thanks for any ideas you have.

    EDIT:
    Also changing this once more shouldnt matter though cause no ones responded yet and i dont wanna flood this with threads...

    This is actionscript i got from a tutorial to make a dynamic graph but its only increasing vertically (i want it to go horizontally) i swapped the movie to expand horizontally but its still going vertically.Any ides? Theres some other stuff but it just loads in values from a text file and the other one reloads the frame this code is in. bar is a movie containing an increasing block with a motion tween 1-100 frames. there are 14 instances of it each with the number next to bar (bar1, bar2, etc.)

    Code:
    a = 1;
    while (Number(a)<14) {
    	tellTarget ("bar" add a) {
    		gotoAndStop(eval("_level0/:bar" add ../:a));
    	}
    	a = Number(a)+1;
    }
    Last edited by bluewalrus; 11-27-2008 at 02:04 AM.

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Look into the TextField.autoSize property.

  3. The Following User Says Thank You to Medyman For This Useful Post:

    bluewalrus (11-28-2008)

  4. #3
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    That does look like what I want but the code on that page doesnt work I tried putting it in and then playing around with it but I just get this error message
    "1037: Packages cannot be nested.

  5. #4
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    I'll try and be more specific....

    I have a flash file It's AS2. I want to have a dynamic text field on frame 25 within a movie clip called content3. On frame 3 I have 10 buttons if one of those buttons is hit i want to to go to frame 25 and load text from one of ten external text files into that dynamic text field. I also want the dynamic text field to expand only as far as the content is height wise i want a set width. I've created the text field, external files, and buttons but can not get the text to load into the text field nor to load at the least. Thanks for any ideas you can offer. Below is the code I have for the 1 of the buttons so far .
    Code:
    contentMain.infokeena.onRelease = function() {
    loadVarsText = new loadVars();
    loadVarsText.load("data.txt");
    gotoAndStop(25);
    };

  6. #5
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,486
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Do you have your whole system set up correctly? Here is what you need to do:

    1. Give your Dynamic Text box a variable name (for this I will use "myText")
    2. In the .txt you are loading, you need to state the variable name:
    Code:
    myText= blah blah this is loaded blah blah
    3. Now we need to load the text into the MC, not at root level. So we have a button (lets call it btn1 since you have 10) and we want to load it into MC named content3..
    Code:
    but1.onRelease=function(){
    loadVariablesNum ("data.txt", "_root.content3");
    }
    4. Ensure all .txt files and the swf/html are in the same folder when uploaded. <~~ Most common mistake

    That should do it.
    {CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
    Follow Me on Twitter: @Negative_Chaos
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  7. #6
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by bluewalrus View Post
    That does look like what I want but the code on that page doesnt work I tried putting it in and then playing around with it but I just get this error message
    "1037: Packages cannot be nested.
    package? Did you copy and paste some random example from the page that I linked to?

    All you needed to do is add:
    Code:
    textfield.autoSize = "LEFT"
    where textfield is the instance name of your text field.

  8. #7
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Oo ok. Yeah, I thought the code included in that was a tutorial code to try it in flash and modify, not a just a sample of how to write it.

    I tried using that code but I don't think the text is loading in properly or maybe the text field is not loading? I don't know which but this is the code I'm trying to use to do it.
    contentMain is one movie and contentMain3 is another movie which contains load_it a dynamic text field located on frame 25.
    Code:
    contentMain.infokeena.onRelease = function() {
    	loadText = new LoadVars();
    	contenMain3.loadText.load("data.txt");
    	contentMain3.load_it.autoSize = "LEFT";
    	gotoAndStop(25);
    };

  9. #8
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,486
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    what does data.txt look like?
    {CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
    Follow Me on Twitter: @Negative_Chaos
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  10. #9
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    it contains
    text=KEENA

  11. #10
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,486
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    so your dynamic text box has a variable of "text"?
    {CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
    Follow Me on Twitter: @Negative_Chaos
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •