Actionscript problem with attachMovie and displaying text in a textinput

Posted on 2007-10-02
Last Modified: 2012-06-21
Actionscript / Flash Problem

I have created a dynamic movie clip which has a number of text inputs in it i need to create this movic clip and then put text in the inputs ,
if i trace out to the output panel the text value of the inputs i get the right value but it wont display in the text input

here is the as class

import mx.controls.DateField;
import mx.controls.Button;
import mx.controls.TextInput;
import mx.controls.DataGrid;
import mx.utils.Delegate;

class CreateMARChartForm extends arpx.ArpXForm
      var startDateField:DateField;
      var endDateField:DateField;
      var pDataGrid:DataGrid;
      var saveDetailsButton:Button;
      var detailsArray:Array;

      function CreateMARChartForm()


      function onLoad()
            saveDetailsButton.addEventListener("click", Delegate.create(this , saveDetails) );
      var pVO;
      var mcArray:Array;
      var intervalID;
      public function populatep(pVO:PVO):Void
            mcArray = new Array();
            this.pVO = pVO;
            for(var i = 0; i < pVO.getPArray().length; i++)
                  var p = pVO.getPArray()[i];

                  var rowItem:Array = new Array();
                  rowItem['Qty']      = p.getQuantity() + " " + p.getUomName();
                  rowItem['Item'] = p.getPName();

                   mcArray[i] = this.attachMovie("marTimings", "marTimings_mc"+i, this.getNextHighestDepth(), {_x:50, _y:180 + (i * 60)});


            p.getColumnAt(0).cellRenderer = "MultiLineCell";
            .selectedIndex = 0 ;

      private function prepopulateDetails():Void
            for(var i = 0; i < VO.getPItemArray().length; i++)
                  var pItem = pVO.getItemArray()[i];
                  var detailsArray:Array = pItem.getMARDetails();
                  if(detailsArray != undefined)
                        mcArray[i].time1TextInput.label.text = detailsArray[0][0];
                        mcArray[i].time2TextInput.label.text = detailsArray[0][1];
                        mcArray[i].time3TextInput.label.text = detailsArray[0][2];
                        mcArray[i].time4TextInput.label.text = detailsArray[0][3];
                        mcArray[i].time5TextInput.label.text = detailsArray[0][4];

                        mcArray[i].quantity1TextInput.text = detailsArray[1][0];
                        mcArray[i].quantity2TextInput.text = detailsArray[1][1];
                        mcArray[i].quantity3TextInput.text = detailsArray[1][2];
                        mcArray[i].quantity4TextInput.text = detailsArray[1][3];
                        mcArray[i].quantity5TextInput.text = detailsArray[1][4];            

      private function setUpDataGrid():Void
            pDataGrid.getColumnAt(0).width = 250;
            pDataGrid.getColumnAt(1).width = 75;
            pDataGrid.sortableColumns = false;
            pDataGrid.rowHeight = 40;
      private function saveDetails():Void
            detailsArray = new Array();

            for(var i = 0; i < pVO.getItemArray().length; i++)
                  var timeingsArray = new Array(new Array(), new Array());
                  timeingsArray[0][0] = mcArray[i].time1TextInput.text;
                  timeingsArray[0][1] = mcArray[i].time2TextInput.text;
                  timeingsArray[0][2] = mcArray[i].time3TextInput.text;
                  timeingsArray[0][3] = mcArray[i].time4TextInput.text;
                  timeingsArray[0][4] = mcArray[i].time5TextInput.text;

                  timeingsArray[1][0] = mcArray[i].quantity1TextInput.text;
                  timeingsArray[1][1] = mcArray[i].quantity2TextInput.text;
                  timeingsArray[1][2] = mcArray[i].quantity3TextInput.text;
                  timeingsArray[1][3] = mcArray[i].quantity4TextInput.text;
                  timeingsArray[1][4] = mcArray[i].quantity5TextInput.text;

      public function getTimeings():Array
            return detailsArray;

Question by:jockmahon
    LVL 34

    Accepted Solution

    use "anti-alias for animation" type from drop down
    and embed the font glyphs

    Author Comment

    The inputs are the TextInput UI component not a textinput does that make a difference

    LVL 34

    Expert Comment

    by:Aneesh Chopra
    if you have used any mask on the movieClip which has textInput UI components, then you must used embed fonts..

    instance.embedFonts = true;

    Author Comment

    There are no masks applied to the mc, when the form is loading i can briefly see the values before the inputs full load this is when i use the following to place the values ins

    mcArray[i].time1TextInput.label.text = detailsArray[0][1];

    Author Comment

    ok changed all the components to textinputs and have it working now not exactly what i wanted but have been at it all day and getting so buggered off with it , thanks for your help

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Javascript: Crash Course

    Javascript is not only emerging as the most important language to know, it's flexibility is unique. With Javascript being deployed on the web, mobile and even the desktop this is the one language that all technologists need to know.

    Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
    The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now