[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 160
  • Last Modified:

Get original MovieClip name from Library with Actionscript

I need to be able to access a property of my components that will tell me whether or not they are a ComboBox, TextArea, etc.  If I use the ._name property it gives me the instance name, how do i get the original name like ComboBox with Actionscript?
0
stewdogg61
Asked:
stewdogg61
  • 2
  • 2
1 Solution
 
MontoyaProcess Improvement MgrCommented:
what are you trying to accomplish? there is no property in the UIcomponent class that identifies the type of class. Maybe if you can describe what you're actually trying to do...perhaps there's a workaround.
0
 
stewdogg61Author Commented:
On my page I have 37 different compenents, some of them are ComboBox components, some are TextInput, some are TextArea.  The instances are named sequentially "cca1", "cca2", and so on.  I want to be able to check and see if _root["cca"+i] is a ComboBox or a TextInput, etc.  Right now I have the following script running, but I only want it to execute if the component type is a ComboBox:

for(i=1;i<38;i++){
     _root["cca"+i].editable = true;
     _root["cca"+i].rowCount = 3;
     _root["cca"+i].addItem("");
}

I was thinking if I could just get to the MovieClip name (the actual name in the Library) I could check to see if that was equal to "ComboBox" and then only run the code then.
 
0
 
stewdogg61Author Commented:
I figured it out:

for(i=1;i<38;i++){
     if(_root["cca"+i].addItem("")){
          _root["cca"+i].editable = true;
          _root["cca"+i].rowCount = 3;
     }
}

This made it so it only made the ComboBox components editable becuase they were the only components that allowed the addItem property.
0
 
MontoyaProcess Improvement MgrCommented:
if you reached your conclusion without our assistance, you can ask the mods to cancel the question, and your points will be reimbursed.

Glad you reached the answer.
0
 
GranModCommented:
PAQed with points refunded (500)

GranMod
Community Support Moderator
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now