12-05-2003, 06:47 AM
|
#1
|
|
lala
Join Date: Feb 2002
Location: on the road
Posts: 2,858
|
making your own args list for a component
hi there
I would like to know if there is anyway to specify my own list of arguments for the user to choose from, on my component parameters.
for example, when defining a component and i choose boolean as the argument type the user can choose either true or false.
so i wrote a component, adn i want the user to choose which return format he would like to get so is this a possibility.
Ciao
|
|
|
12-05-2003, 08:23 AM
|
#2
|
|
Flash Safely!
Join Date: Sep 2002
Location: Holland
Posts: 1,092
|
Hey hangalot, you're keeping yourself busy lately
That's possible with inspectable metatags I believe, which you declare in the class code. They reveal certain class properties in the component inspector, and give them legal values to chooce from.
here's some reading on them:
http://www.macromedia.com/devnet/mx/...test_comp.html (page 5)
http://www.macromedia.com/devnet/mx/...component.html (page 5)
I haven't really worked with them though, so let it know how it works out
|
|
|
12-21-2003, 10:15 AM
|
#3
|
|
lala
Join Date: Feb 2002
Location: on the road
Posts: 2,858
|
finally got around to using them. 
so thanks 4 the articles that is where i got the info - specially the second one.
very easy and very nice.
this is how it works:
ActionScript Code:
[Inspectable(type="String", defaultValue="column name" )]
public function set fieldName(inVal:String){
__fieldName = inVal;
return;
};
public function get fieldName():String{
return __fieldName;
};
[ Inspectable( enumeration="varChar,Numeric", defaultValue="varChar" ) ]
public function set dataType(inVal:String){
__dataType = inVal;
return;
};
public function get dataType():String{
return __dataType;
};
by placing these metatags in ur class u don't have to define the properties individualy in the component definition, then in the component definition panel u specify ur as2 class (u would have maybe noticed that if u did this all ur properties disapeared which was set?) and voila` ur properties are auomatically set.
here i defined a string and a list as choices
anyways njoy.
|
|
|
12-22-2003, 05:24 AM
|
#4
|
|
Flash Safely!
Join Date: Sep 2002
Location: Holland
Posts: 1,092
|
Hey hangalot,
Yeah I also already tried some of them, and like it. Really a convienant and elegant solution here, as supposed to the setting parameters in FMX components  .
|
|
|
12-22-2003, 06:11 AM
|
#5
|
|
lala
Join Date: Feb 2002
Location: on the road
Posts: 2,858
|
ja
|
|
|
12-22-2003, 06:33 AM
|
#6
|
|
Flash Safely!
Join Date: Sep 2002
Location: Holland
Posts: 1,092
|
Zeker weten.
|
|
|
12-22-2003, 06:51 AM
|
#7
|
|
lala
Join Date: Feb 2002
Location: on the road
Posts: 2,858
|
i have another question, maybe you have solved this, but I hav not been able to find a sollution to this.
lets say i have a meta tag that is an array, i want each item in the array to choose from an enumeration.
i don't think this is easily done, maybe something like jsfl would be the answer, but maybe u know...
|
|
|
12-22-2003, 02:36 PM
|
#8
|
|
Flash Safely!
Join Date: Sep 2002
Location: Holland
Posts: 1,092
|
To be honoust I have absolutely no idea. As you said perhaps a seperate jsfl popup which looks up the correct enumeration belonging to a certain inspectable array element in the class file. Not sure if it's possible though, I haven't tried it yet anyway  .
|
|
|
12-23-2003, 07:00 PM
|
#9
|
|
lala
Join Date: Feb 2002
Location: on the road
Posts: 2,858
|
something along the same lines that I have not been able to resolve is how to inherit inspectable properties
From the MM help file...
InspectableList
Use the InspectableList metadata keyword to specify exactly which subset of
inspectable parameters should appear in the Property inspector. Use
InspectableList in combination with Inspectable so that you can hide
inherited attributes for subclassed components. If you do not add an
InspectableList metadata keyword to your component's class, all inspectable
parameters, including those of the component's parent classes, appear in the
Property inspector.
The InspectableList syntax is as follows:
[InspectableList("attribute1"[,...])]
// class definition
The InspectableList keyword must immediately precede the class definition
because it applies to the entire class.
The following example allows the flavorStr and colorStr properties to be
displayed in the Property inspector, but excludes other inspectable
properties from the DotParent class:
[InspectableList("flavorStr","colorStr")]
class BlackDot extends DotParent {
[Inspectable(defaultValue="strawberry")]
public var flavorStr:String;
[Inspectable(defaultValue="blue")]
public var colorStr:String;
...
}
////
any ideas?
|
|
|
12-24-2003, 06:22 AM
|
#10
|
|
Flash Safely!
Join Date: Sep 2002
Location: Holland
Posts: 1,092
|
I'm not sure, what are you trying to achieve exactly?  .
|
|
|
| Thread Tools |
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 01:35 PM.
///
|
|