[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Actionscript problem with attachMovie and displaying text in a textinput

Posted on 2007-10-02
Medium Priority
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
  • 3
  • 2
LVL 34

Accepted Solution

Aneesh Chopra earned 1500 total points
ID: 19998390
use "anti-alias for animation" type from drop down
and embed the font glyphs

Author Comment

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

LVL 34

Expert Comment

by:Aneesh Chopra
ID: 19998476
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

ID: 19998507
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

ID: 19998608
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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
The viewer will learn how to dynamically set the form action using jQuery.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
Suggested Courses
Course of the Month19 days, 15 hours left to enroll

873 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