Dynamic text is inside movieClip

I am working on flash & AS file, in flash file (main.fla) dynamic text is inside that movieClip (myButton) .I will like to send some text to that particular dynamic text field inside the movieClip (myButton) from AS file
as file code is
var myButton:Button;
var myText:text;
myButton.myText.text="Custom Msg";
I import .as file in flash but it is not showing can anybody help me?

This is working fine but my problem is that, in my another application I am importing the class from as file in that as file I have one loop
if(errorCode == 0){
         trace("welcome ");
         mc.myText.text="Custom Msg";
          }else{
             trace("Error loging in to Server Error Code : "+ errorCode)
It will trace message properly
my problem is that I will like to put "Custom Msg" in dynamic text which is in MovieClip (mc) of fla file, how could I go wtih this ?
If I include same as file in flash It will shows as error
1037: Packages cannot be nested. What the solution for this ?

Similar Messages

  • Targeting Dynamic Text Box inside moviecip with variable

    Hi,
    How does one target a dynamic text box to change the border
    color inside of a movie clip? Example below which does not work
    theName = ("answerPrint" + arryCount);
    boxName = ("box" + (arryCount+1));
    _root.pagePrintPartA[theName][boxName].border = true;
    _root.pagePrintPartA[theName][boxName].borderColor =
    0x00cc66;

    Thanks for the reinforcement, but I should of indicated what
    was what:
    theName = ("answerPrint" + arryCount);// Name of Variable
    inside Dynamic Text Box Inside MovieClip
    boxName = ("box" + (arryCount+1));// Instance Name of Actual
    Dynamic Text Box Inside MovieClip
    _root.pagePrintPartA[theName][boxName].border = true;
    _root.pagePrintPartA[theName][boxName].borderColor =
    0xFF0000;
    By certifying this script you showed me wher I went wron (not
    seeing the forest from the trees). The last two lines should be:
    _root.pagePrintPartA[boxName].border = true;
    _root.pagePrintPartA[boxName].borderColor = 0xFF0000;
    I was targeting backwards. Thanks alot DazFaz.

  • Using loadVariables() to populate a Dynamic Text in a MovieClip

    Hello everyone,
    I am trying to populate a Dynamic Text with data from a
    remote database. I have no problem populating the Dynamic Text with
    the data from the remote database if the Dynamic Text is placed in
    the main timeline using the following code.
    loadVariables ("php/attorney.php", "");
    Once I move the Dynamic Text into a Movie Clip with instance
    name of “MC_But_1” I am only able to populate the
    Dynamic Text if I place the above code in the movie clip. Since it
    is going to take sometimes for the data to be transferred from the
    remote database I rather to do this on the main timeline before the
    MC_But_1 is shown. I have used the following code but for some
    reason it is not working.
    loadVariables ("php/attorney.php", _root.MC_But_1);
    Can someone be kind enough to tell me where I am going wrong?
    Thank you very much and have a great day.
    Khoramdin

    > Since it is going to take sometimes for the data to be
    > transferred from the remote database
    That is one of the best arguments for abandoning
    loadVariables() in
    favor of LoadVars(). Check that out in the manual. It's
    better because
    there are events that get triggered when a data transfer has
    completed
    and you can write an event handler script to deal with server
    responses.
    Christian Scholz-Flöter

  • Drag movie clip with dynamic text box inside it?

    Hi team, I can drag a movieclip with static text inside it, but when I change the text to dynamic, I get a Property Startdrag not found on Flash.text.textfield and there is no default value.. Any help?
    Cheers
    sub

    assign the mouseChildren property of your movieclip to false.

  • Showing RSS feed in Dynamic Text box (with hyperlink)

    Hi all -
    I am currently trying to pull RSS data into a project for my first time and am trying to get 3 (potentially 4) boxes filled with rss data that will be updated. So far, I am going with Actionscript 3. So far I have the code below, but it puts data in a listbox. What is the easiest way to put the data in three dynamic text boxes inside a movie clip, so I have one for the title, one for description and one for link (shown as 'read more' text but a link using the url from the rss value)?
    I am really banging my head against the wall on this one and want to get it sorted asap, so any help would be GREATLY appreciated! I have also attached an image to show what I am trying to do:
    I also want to know if it's possible to show rss values only if they exist. For example, my xml feed currently only has 3 items that change, and i will be assigning these to boxes, but is it possible to display a fourth if it exists, and if it doesn't it just shows the first?
    My code so far:
    var loader:URLLoader = new URLLoader();
    loader.addEventListener(Event.COMPLETE, onLoaded);
    var xml:XML;
    function onLoaded(e:Event):void
        xml = new XML(e.target.data);
        var il:XMLList = xml.channel.item.description};
        trace(il[1]);
             lb.addItem({data:il.description.text()
                                label:il.title.text()}):
    loader.load(new URLRequest("http://www.rssfeedhere.xml"));

    you would create a movieclip (exported for actionscript and class = rssItem) with 3 textfields and the display shown in your message and use something like:
    var loader:URLLoader = new URLLoader();
    loader.addEventListener(Event.COMPLETE, onLoaded);
    var xml:XML;
    function onLoaded(e:Event):void
        xml = new XML(e.target.data);
        var il:XMLList = xml.channel.item.description};
        for(var i:uint=0;i<il.length();i++){
            var mc:rssItem = new rssItem();
            addChild(mc);
            mc.x = 300*i%2;
            mc.y = 300*Math.floor(i/2);
            mc.titleTF.text = il[i].title.text();
            mc.descriptionTF.text = il[i].description.text();
            mc.readmoreTF.text = ?
    loader.load(new URLRequest(http://www.rssfeedhere.xml));

  • Text object inside MC tracked as button

    Hi people!
    I'm trying to use a dynamic text box inside a movie clip
    tracked as button, but the text box object is not recognized. The
    system refers to it as instanceX where X is a random number. Below
    an example of the debug list object:
    Level #0: Frame=1
    Button: Target="_level0.circle_mc"
    Shape:
    Edit Text: Target="_level0.circle_mc.instance7" Variable=
    Visible=true Text = "
    Anyone knows how to correct this problem or how to access the
    object.

    two accordion widgets next to each other maybe?
    widgets library > panels > accordion

  • Scaling Dynamic Text Fields

    I have some dynamic text fields inside a movie clip that can
    be scaled (zoomed). When the holder clip is scaled, however, the
    word wrap of the text field changes.
    Is there a way to lock the word-wrap so that it doesn't
    shift?

    Got it-- I just needed to embed the fonts.

  • On button rollover Dynamic text and Movieclip appear

    Hi guys,
    I've got an issue - When one of my buttons is rolled over, I want text and a movieclip to appear. When the button is no longer rolled over, I want the text and movieclip to disappear.
    The way that I was going to do this was to have anchor_mc as an anchor, and upon rollover have the movieclip play from inside the anchor (as its at the exact X & Y that its needed at) and dynamic text appear.
    Questions:
    1) How do I attach mc_textbox to mc_anchor --- OR, how do I set coordinate for just where mc_textbox should show?
    2) How do I then make the movieclip disappear if the button is no longer rolled over?
    3) Is it not possible for me to merge all of the dynamic text functions into one function, using IF statements? I tried this, but couldn't work it out.
    AS3 code is attached below.
    import flash.events.MouseEvent;
    stop();
    line1.addEventListener(MouseEvent.ROLL_OVER, line_in1, false, 0, true);
    line1.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
    line2.addEventListener(MouseEvent.ROLL_OVER, line_in2, false, 0, true);
    line2.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
    line3.addEventListener(MouseEvent.ROLL_OVER, line_in3, false, 0, true);
    line3.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
    line4.addEventListener(MouseEvent.ROLL_OVER, line_in4, false, 0, true);
    line4.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
    line5.addEventListener(MouseEvent.ROLL_OVER, line_in5, false, 0, true);
    line5.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
    line6.addEventListener(MouseEvent.ROLL_OVER, line_in6, false, 0, true);
    line6.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
    line7.addEventListener(MouseEvent.ROLL_OVER, line_in7, false, 0, true);
    line7.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
    line8.addEventListener(MouseEvent.ROLL_OVER, line_in8, false, 0, true);
    line8.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
    line9.addEventListener(MouseEvent.ROLL_OVER, line_in9, false, 0, true);
    line9.addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
    function line_in1(e:MouseEvent):void
            line_output.text = "This is a test made by the MonkeyTest that has previously messed up\n        And testing a new line";
    function line_in2(e:MouseEvent):void
            line_output.text = "up messed previously has that MonkeyTest the by made test a is This";
    function line_in3(e:MouseEvent):void
            line_output.text = "This is a test made by the MonkeyTest that has previously messed up\n        And testing a new line";
    function line_in4(e:MouseEvent):void
            line_output.text = "up messed previously has that MonkeyTest the by made test a is This";
    function line_in5(e:MouseEvent):void
            line_output.text = "This is a test made by the MonkeyTest that has previously messed up\n        And testing a new line";
    function line_in6(e:MouseEvent):void
            line_output.text = "up messed previously has that MonkeyTest the by made test a is This";
    function line_in7(e:MouseEvent):void
            line_output.text = "This is a test made by the MonkeyTest that has previously messed up\n        And testing a new line";
    function line_in8(e:MouseEvent):void
            line_output.text = "up messed previously has that MonkeyTest the by made test a is This";
    function line_in9(e:MouseEvent):void
            line_output.text = "up messed previously has that MonkeyTest the by made test a is This";
    function line_out(e:MouseEvent):void
            line_output.text = "";
            var mc= new mc_empty(); addChild(mc);

    It isn't relly clear to me what you have versus what you want, so these answers may be equally unclear to you.
    1. One way to join them together is to maually place one inside the other while authoring the file.  Another way is to use addChild to add the text mc to the anchor...  mc_anchor.addChild(mc_textbox);  To control where the text mc appears you can set its x and y properties.using actionscript... mc_textbox.x = 0;
    2. To make the movieclip disappear you can set its visible property to false... mc_anchor.visible = false;
    3. You can probably reduce that code substantially, though it partly depends on what variations there are really going to be in the text that displays for each rollover.  For now, I'll assume the text will be entirely different for each...
    for(var i:uint=1; i<10; i++){
         this["line"+String(i)].addEventListener(MouseEvent.ROLL_OVER, line_in, false, 0, true);
         this["line"+String(i)].addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
    function line_in(e:MouseEvent):void {
         var lineTarget:MovieClip = MovieClip(e:currentTarget);
          // could use a switch instead of the if's in series if you know what a switch is
         if(lineTarget == line1){
              // do things for line1
         } else if(lineTarget == line2){
              // do things for line2
         ) else if.... etc

  • How to load dynamic text inside a movie clip?

    hello all - i have a main stage where on the first frame my
    "home" movie clip displays. i did this by dragging/dropping, and
    then i put a stop action. all works fine.
    inside this home movie clip on the main stage, there are
    links to other movie clips. for example, to get to my faq's page -
    you click that button, then it takes you to frame 4 on my main
    stage, where my faq's movie clip (followed by stop action) has been
    dragged/dropped and displays properly.
    within the faq's movie clip this process is repeated, with
    buttons taking to you various pages (different frames where
    different movie clips play - all works fine).
    so now i want to add a dynamic text field within my faq's
    movie clip. i have read numerous tutorials where i have created the
    text file but i have not been able to display it with success
    within my faqs movie clip.
    here is some code that my dvd tutorial instructs me to place
    on main stage as i practice getting this to work:
    var myMCL:MovieClipLoader = new MovieClipLoader ();
    var myListener:Object = new Object();
    myMCL.addListener(myListener);
    var myLV:LoadVars = new LoadVars();
    myLV.onLoad = function (success:Boolean) {
    if (success) {
    _level5.loadedInfo.htmlText = myLV.info;
    } else {
    _level5.loadedInfo.text = "There has been an error loading
    the requested information. Please contact the webmaster.";
    and here is some code that i place on the faqs button within
    my main movie clip that takes me back to main stage and plays faq
    movie clip all successfully:
    on (release) {
    //Movieclip GotoAndPlay Behavior
    _root.gotoAndPlay("4");
    //End Behavior
    and finally, here is some code that i place within my faqs
    movie clip in an attempt to display my dynamic text within the faqs
    movie clip - so far unsuccessful:
    _level0.myLV.load("vars/faqs.txt");
    NOTE:
    i have published this to view - not working.
    i have my faqs text file starting as info=
    i have eliminated white space within my text file
    i am using flash 8 pro
    can anyone offer some sugestions? thanks!

    hmmmmm lemme double check as i seem to be a bit lost now.
    // this is my actions layer code on frame 4 of main timeline:
    stop();
    var myLV:LoadVars = new LoadVars();
    myLV.onLoad = function (success:Boolean) {
    if (success) {
    _level5.loadedInfo.htmlText = myLV.info;
    } else {
    _level5.loadedInfo.text = "There has been an error loading
    the requested information. Please contact the webmaster.";
    myLV.load("vars/faqs.txt");
    1. fyi - at frame 4 on main timeline, one layer beneath the
    actions layer where i dragged/dropped my faqs movie clip i gave my
    faqs movie clip an instance name of "mainfaqs" - although nowhere
    do i refer to this specific mc within my code.
    2. where would i replace/insert the following code?
    _level0.faq_mc.loadedInfo.text = myLV.info;
    3. i didn't know about embedding font but i saw the option
    and embedded it - still no results.
    4. i'm not sure how to do the following:
    _level5.loadedInfo.text ='test'; //although I would still
    change the path as above
    To see if your getting a return from the load call adn text
    file, use a trace statment before the success condition and see
    what it returns:
    trace(myLV);
    sorry to be such a pain - i really have looked around for
    answers through previous postings and i googled it and i've been
    taking instruction through lynda.com and dvds but i seem to be
    stuck here.... as always - thanks for your time

  • Show inside dynamic text the title for multiple images on mouseover

    I have 25 animated movieclips dragged on the stage and they have similar instance names for easier manipulation purposes inside programming using loops. The instance names look like this: image0, image1, image2 and so on.
    Each time I go mouseover on one of these unique images I want to show the unique title of that image using for all titles just one dynamic text container named imageTitle.
    I have succeeded to make this work image by image but this would require me to copy paste and modify for each image the following code.
    image0.onRollOver = function() {
        imageTitle.text = "First image title";
        imageTitle.textColor = 0x000000; // setting the text color here
    image0.onRollOut = function() { 
        imageTitle.text = "Choose an image";
        imageTitle.textColor = 0x000000;
    Question: The above code would work but seems redundant to me. Since I have similar instance names (image0, image1, ....,image24), how can I put this code inside a loop or something in order to work for all images without repeating this code 25 times.
    Update: I have added an array to the project that contains all the titles:
    var imagesTitles = new Array("First image title", "Second image title", .... ); 

    imageTitle.textColor=0x000000;
    for(var i:Number=0;i<imagesTitles.length;i++){
    this["image"+i].ivar = i;  // key step
    this["image"+i].onRollOver=function(){
    imageTitle.text = imagesTitles[this.ivar];  // key step used here
    this["image"+i].onRollOut=function(){
    imageTitle.text="Choose an image";

  • Dynamic Text and Resizing Images Inside

    Hello.
    FYI: I'm following the Flash Blogger tutorials listed on
    http://www.indextwo.net with
    Flash 8.
    I've noticed that everything works wonderfully as far as
    bringing the blog content into the dynamic text field; however, my
    only problem at the moment is while Blogger will automatically
    resize my images, so it doesn't mess up the current template in
    html, but of course, Flash does not (out of the box).
    I need a way to define the width & height of the images in
    the text field to fit inside the dynamic text field they're in.
    As far as I can tell, the tutorials listed on that site use an
    alternate method and don't actually resize them. They just make a
    link to them.
    Lastly, I thought about using CSS in Flash to adjust the img
    size, but from what I gather there are very few items at my
    disposal.
    Does anyone have a solution?
    Thank you.

    Hello.
    FYI: I'm following the Flash Blogger tutorials listed on
    http://www.indextwo.net with
    Flash 8.
    I've noticed that everything works wonderfully as far as
    bringing the blog content into the dynamic text field; however, my
    only problem at the moment is while Blogger will automatically
    resize my images, so it doesn't mess up the current template in
    html, but of course, Flash does not (out of the box).
    I need a way to define the width & height of the images in
    the text field to fit inside the dynamic text field they're in.
    As far as I can tell, the tutorials listed on that site use an
    alternate method and don't actually resize them. They just make a
    link to them.
    Lastly, I thought about using CSS in Flash to adjust the img
    size, but from what I gather there are very few items at my
    disposal.
    Does anyone have a solution?
    Thank you.

  • Scrolling event: movieclip instead of dynamic text

    Hello everybody. I am very very novice to actionscript, so probably my question will sound a little silly.
    I am trying to put an arabic text to scroll with a custom scrollbar. So I found a nice video in youtube about doing that with a dynamic text field. It works wonderful for latin characters (left to right and separated letters) but unfortunately not for arabic characters (they don't get connected). Actually, I don't care to use just a movieclip with the text instead of the dynamic text field. But I don't know how to change the actionscript code for the movie clip instead of the dynamic text field.
    Here I show you the code for the scrolling text in a dynamic text field (it's a short code), on the stage I got just the dynamic text field (instance name: texto_txt), the scrollBar (a vertical line, instance name: scrollBar_mc) and the scroller itself (a little rectangle, instance name:scrollHandle_mc):
    var content:String = "cjeihfirehjfejlkfjkerjfirjfejifjrijwkjfirwjekñlkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkllllllll";
    texto_txt.text = content;
    texto_txt.wordWrap = true;
    var min: Number = scrollHandle_mc.y;
    var max: Number = min +(scrollBar_mc.height - scrollHandle_mc.height);
    var intervalo: Number = max - min;
    var arrastrando: Boolean = false;
    var bounds: Rectangle = new Rectangle (scrollHandle_mc.x, scrollHandle_mc.y, 0, scrollBar_mc.height - scrollHandle_mc.height);
    scrollHandle_mc.addEventListener (MouseEvent.MOUSE_DOWN, arrastrandoScroll);
    stage.addEventListener (MouseEvent.MOUSE_UP, stopIt);
    function arrastrandoScroll(mouseEvent:MouseEvent)
    scrollHandle_mc.startDrag(false,bounds);
    arrastrando = true;
    scrollHandle_mc.addEventListener(Event.ENTER_FRAME, progress);
    function stopIt(mouseEvent:MouseEvent)
    scrollHandle_mc.stopDrag();
    arrastrando = false;
    function progress(e:Event)
    var moverScroll:Number = scrollHandle_mc.y - min;
    var percent:Number = moverScroll/intervalo;
    if (arrastrando == true)
    texto_txt.scrollV = percent * texto_txt.maxScrollV;
    What I want to do is clear the dynamic text field and use instead a movieclip (text_mc) that includes already the text, the bounding box would be a mask. How do I change the actionscript? Could anyone help me out?

    It isn't really a matter of math, as much as it is logical reasoning, but if you plan to do things with programming, you better plan on getting comfortable with learning math as well.  Programming and math go hand-in-hand.
    Here's a simplified explanation of what your code needs to do -> If you move the scroller 25% of the total distance it can move, then the movieclip should be moved 25% of the distance it can move (in the oppostie direction).
    Your scroller handle can be moved a predefined distance.  In your code that value is called "intervalo".  See if you can figure out how that value is determined in the 3 lines of code.
    var min: Number = scrollHandle_mc.y;
    var max: Number = min +(scrollBar_mc.height - scrollHandle_mc.height);
    var intervalo: Number = max - min;
    Later on in your progress function you can see where the scrollbar handle values com into play again when determining where to place the textfield.  But if we change that to be the movieclip, it becomes more like the following...
    function progress(e:Event)
        var moverScroll:Number = scrollHandle_mc.y - min;
        var percent:Number = moverScroll/intervalo;
        if (arrastrando == true)
             yourMC.y = percent * (yourMCmaxY-yourMCminY) + yourMCMinY;
            // where  yourMCmaxY-yourMCminY is the mc's movement range
            // which is likely to be negative since yMax is likely < yMin for the mc.

  • RollOver movieClip to display dynamic text

    I have no ides how to do this.
    It must be easy but I can't seem to get it. I have a movie
    clip called A_mc and a dynamic text field called instance name
    "Names", when the mouse rolls over the A_mc I want a name assigned
    to the A_mc to show up in the Names text field.
    It seemed simple enough, I have seen it used in educational
    SWF when the mouse rolls over the A_mc the name of that part or
    area shows us in the text field.
    But I need help HHEELLLP

    Thanks Gibbah
    For your help, I don't think I thgink the right way for
    Flash, I know it takes time but this seems to be driving me mad.
    The code you gave me, that is attached to the A_m (Movie
    Clip).
    The Dynamic Text called names appears on the swf along with
    the A_m symbol but no action
    I get and error
    The class or interface 'Event' could not be loaded.
    CODE
    on(rollOver){
    A_mc.addEventListener(MouseEvent.MOUSE_OVER,showName);
    function showName(e:Event):void {
    A_mc.Names.text= "Rob Beckett";
    I must be doing something else wrong
    Rob

  • Linking a class to a dynamic text field to load XML data.

    Hi,
    I'm quite new to ActionScript and would be grateful for any help here.
    I want to load text into a dynamic text field (called 'about_tab') using  a class depending on the language selected (by clicking on a flag icon)  by the user.
    I managed to get this to work when the ActionScript was written directly  in the timeline, but am having problems with doing the same thing via a  class.
    This is my class file:
    package
    import flash.display.SimpleButton;
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    import flash.net.URLRequest;
    import flash.net.URLLoader;
    import flash.events.Event;
    public class ChangeLang extends SimpleButton
    public function ChangeLang()
    addEventListener(MouseEvent.CLICK, switchLang);
    trace("ChangeLang class working");
    public function switchLang(event:MouseEvent):void
    var lang = event.target.name;
    var req:URLRequest = new  URLRequest("languages/"+lang+".xml");
    var loader:URLLoader = new URLLoader();
    var substance:XML;
    function xmlLoaded(event:Event):void
    trace("function xmlLoaded is running");
    substance = new XML(loader.data);
    about_tab.text =  substance.about_lbl;
    loader.addEventListener(Event.COMPLETE, xmlLoaded);
    loader.load(req);
    Here's one of my XML files (the other is the same except "About" is  written in German):
    <substance>
    <about_lbl>About</about_lbl>
    </substance>
    When I run it, it returns my trace statements that the class ChangeLang  and the function xmlLoaded are running, but no text appears in the  dynamic text field (I should/want to see the word 'About'). I get this  error message:
    1120: Access of undefined property about_tab
    The problem, I'm guessing, is in the part in red in my code. I think I need to target the text field in the display list by creating a  reference to it. If so, could someonw point out how I do this, or perhaps a tutorial that would help. I've tried adding the word stage (i.e.,stage.about_tab.text =  substance.about_lbl; ) but it still doesn't connect. I guess there's something really simple I'm missing, so I  apologize if this comes across as a stupid question
    Thanks for any help.

    Hello flashrocket!
    I'm also new to AS3 and I've just started using external classes and I think I know what you should do to put your code to work.
    Instead of using the text field you created inside your flash file, why don't you use the "TextField" class to create an instance of this object? It's the exact same thing as when you create and instantiate a new text field inside Flash.
    First, import flash.text.*; (includes classes like TextField, TextFieldAutoSize, TextFormat, TextFormatAlign, etc)
    Than you just have to create a var like
    public var about_tab : TextField;
    or
    public var about_tab : TextField = new TextField();
    then, to adjust the properties of this tab you use dotsyntax as if it where on your stage like:
    about_tab.x = 50; about_tab.alpha = .5; etc...
    you can even create a function to "config your textField"
              private function createAndConfigTextField() : void {
                   about_tab = new TextField(); //you only need this line if you
              // only typed something like "public var about_tab:TextField;
              // if instead you used "public var about_tab:TextField = new TextField(); outside
              // this function, just skip this first line because you already have an instance of
              // text field named "about_tab"...
                            about_tab.autoSize = TextFieldAutoSize.CENTER;
                   about_tab.background = true;
                   about_tab.border = true;
                   var aboutTextFormat : TextFormat = new TextFormat();
                   format.font = "Arial";
                   format.color = 0x000000;
                   format.size = 11;
                   format.bold = true;
                   format.align = TextFormatAlign.CENTER;
                   about_tab.defaultTextFormat = aboutTextFormat;
                   addChild(about_tab);
    This is just an example of what you can do... I hope you get it... let me know if you have any doubt...

  • Dynamic Text and changing Text in AS3

    I have a Dynamic Text box in my Library.  I drag it to my main stage and give it a name..it is now a movieclip. The name is 'mcAdmin'.  I added an event listener for MOUSE_OVER.  I want the text to change color, but for now I'm just trying to change the text; however, it's not displaying the change in text I want.  I do a trace, and the change is in there on the output window, but it is not displayed as such.  How can I :
    1) use AS3 to change the font color of the text
    2) use AS3 to change the text and have it display?
    function onMouseOver_txtAdmin(e:MouseEvent):void
    Mouse.cursor="button";
    //Current mcAdmin text is 'Administration'
    //I want to change the color of Administartion on Mouse_Over
    //but to test if I can get to anything, I'm just trying to change the text.
    mcAdmin.text="Hello";
    trace(mcAdmin.text);
    mcPPMB.alpha=.5;
    mcASB.alpha=.5;
    mcISO.alpha=.5;
    mcEA.alpha=.5;
    mcAdmin.alpha=1;
    mcAdmin.scaleX=1.25;
    mcAdmin.scaleY=1.25;
    Thanks.

    1st
    give the textfield a name, if it hasn't already (sounds like you put it in a movieclip).
    to change the text set the text property of your text field
    like this
    myTextField_txt.text = "here is the text";
    or if it is inside a movieclip
    myClip_mc.myTextField_txt.text = "here is the text";
    To change the color you would need to put a TextFormat on it. To keep the same fontsize, font etc. you could first get the TextFormat from your existing Textfield, change the color of the TextFormat and set it on the TextField.
    // get the Textformat of the first character
                var TF:TextFormat = myTextField.getTextFormat(0,1)
    // set the font color
                TF.color = 0xff0000;
    // put it on the whole text
                myTextField.setTextFormat(TF)

Maybe you are looking for