ActionScript 2.0 :: CreateTextField In A MovieClip?
Jul 18, 2002
I want to be able to create a text field on a movie clip that is already established. I can create a text field on the main flash window, but I am unable to create a text field on a movieclip on the flash window.My MovieClip is called Background with an instance name of myBackground. I try the following line among others I have tried:
Am I referencing the movie clip correctly?I have checked the Complete Reference for Macromedia Flash MX, but could not find anything in there. It seems like that book only skims the surface.
I created a textfield dinamicaly with MovieClip.createTextField, but my text is to long, so I need a scrollbar. How can create and attach the scrollbar to the textfield ? Any idea is welcome, tutorial is super
I'm trying to create rows of information in Flash using createTextField in a dynamically attached movieclip. I have the autoSize property set to "center" to account for varying lengths of text. However when I try to obtain the height of the current textbox so I can set the _y property of my next record, Flash doesn't seem to be recognizing the autoSize property and returns the same height for each record.
I added a second frame in the movieclip I'm attaching with a "trace(this._height)"... The correct height property is shown.
how I can get the height property right away after creating the textbox?
I'm working with a flash program that dynamically creates a user-specified amount of text fields in an MC using the createTextField function. However, it seems only one of the text fields will show up.
I've done some testing, and I found that when you create multiple text fields in an MC using this method, only the most recent one shows up. Is there any way to avoid this?
With the code below how can I add to it to make it a link to an internal movie clip.So when someone clicks on this text it tells another move clip to play.Do I need to create an empty MC and Add this text feild inside that MC?
I'm creating a text field dynmaically and it works great however when I test the movie I can't seem to change any text (like a typical input box on a webpage for example), it appears to be only readonly.
I'm coding a dynamic menu in flash which involves creating a text field for each item in an array (forloop). but i want to create the text field with no set width so that each text field is set to the width of the space that the text inside it takes up..i thought something like
createTextField("name", depth); would do but it doesnt seem to work without all of the parameters createTextField("name", depth, x, y, width, height);
I have searched the forum for this, and there are a couple of similar questions, but no answers (bad sign I guess...).Is it possible to use movieclip.createTextfield and use a component scrollbar?
I'm not having luck setting alpha values with _parents that contain child textFields created dynamically. The text filed doesn't change its _alpha with the other objects in the movie clip.
I'm trying to write a function that I can use for creating text fields - in this case: to make the labels for a navigation menu. But the function is not working and I don't know what's the problem. Vars are: n = name and l = depth.
Code: function makeMenuTab(n, l, x, y, w, h) { var c = createTextField("c"+j, j++); c._x = x;[code]......
I'm trying to do generate a textfield that can automatically figure out how wide and high it's going to be...That way I can scale it's parent movieclip to be 250px wide max..The textfield also shouldn't wrap.
I'm trying to write a function that I can use for creating text fields - in this case: to make the labels for a navigation menu. But the function is not working and I don't know what's the problem. Vars are: n = name and l = depth.
what i WANT is to put the text in the top middle of the movie but no matter what i change in the number it just moves to strange places in different sizes and sometimes cut in half, heres a screenshot of current one.
also, one other thing, this number basically keeps track of people in a chatroom, how can i get flash to refresh itself every few seconds to ensure it has the latest number, just have 2 frames the same and loop them?
If I create a textbox using createTextField, is there a way to make it an input field, instead of dynamic? Also, how can I put a border around it, like you can when you create them manually.
Is there a way of doing a division with a remainder instead of a decimal? The best I could think of was splitting the whole number and the decimal and then multiplying the decimal by whatever it was originally divided by. If that is the best way, how would I find the whole number, if I round it, it might go up instead of down, which I don't want.
I am creating some navigation from an array in a forloop. Foreach item in the array i am creating a text field. Is it possible to create a text field that doesnt have a set width? this is the code i am currently using.
createTextField function has the following signature:createTextField(instanceName:String, ...)it's ok if the instance name is passed as a string literal.but it does not recognise it if it is passed as a name of the variable containing this string:
createTextField("name_of_the_textfield", ...) is OK name_of_the_textfield.type="input"; trace(name_of_the_textfield.type) returns "input"
I feel like I'm missing something obvious here, but I'm unable to add a textfield to any movieclip that I've attached to _root. Here's a generic example:
Im trying to create textfield inside my movieclip dynamically (at runtime). So I created a function called "CreateTextField()" which accepts parameters, including the "instanceName" and "txtValue".
Inside that function is a MovieClip.createTextField() function that takes the values and creates a textfield with the "instanceName" provided and assigns a value to the .text property of the textfield through "txtValue".
The code compiles. But it just doesnt want to show the textfield.
What I am trying to do is: have a dynamically created text field change color when i roll over a movieclip. This is what I have: a movie clip with this code:
The dynamically created textfield (lets call it "header") works fine. However, i cannot seem to get the text field to change color once you roll over the instances. I've tried using " Code: on (rollover) { this.header.textColor = 0xFFFFFF;" } but no such luck....
Trying to accomplish the simplest thing ever.. with no success.I want to create a textfield (all scripted) with a specified width (420) and a varying height:
Code: txt = this.createTextField("body_txt", this.getNextHighestDepth(), 0, 0, 420, 0); txt.multiline = true; txt.autoSize = true; txt.text = text from xml going here........;
This code changes the width.If I remove "autoSize", I see no text (as the height is "0"); WTF? How do I keep the width the same as what I've set, and modify the height?
I am having a bit of a headache with regards to this problem
Code:
class A { private var tf:TextField; private var canvas:MovieClip
[code]....
Why is it that the above code does not work? I need reference to the textfield so i can apply different TextFormats depending on the state of target_mc.Why does flash complain that Void is found where textField is expected?