Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Extensions and Plugins > Components

Reply
 
Thread Tools Rate Thread Display Modes
Old 12-05-2003, 06:47 AM   #1
hangalot
lala
 
hangalot's Avatar
 
Join Date: Feb 2002
Location: on the road
Posts: 2,858
Default 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
__________________
oi poloi
http://www.memorphic.com/news/
hangalot is offline   Reply With Quote
Old 12-05-2003, 08:23 AM   #2
Stimpson
Flash Safely!
 
Stimpson's Avatar
 
Join Date: Sep 2002
Location: Holland
Posts: 1,092
Default

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
Stimpson is offline   Reply With Quote
Old 12-21-2003, 10:15 AM   #3
hangalot
lala
 
hangalot's Avatar
 
Join Date: Feb 2002
Location: on the road
Posts: 2,858
Default

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.
__________________
oi poloi
http://www.memorphic.com/news/
hangalot is offline   Reply With Quote
Old 12-22-2003, 05:24 AM   #4
Stimpson
Flash Safely!
 
Stimpson's Avatar
 
Join Date: Sep 2002
Location: Holland
Posts: 1,092
Default

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 .
Stimpson is offline   Reply With Quote
Old 12-22-2003, 06:11 AM   #5
hangalot
lala
 
hangalot's Avatar
 
Join Date: Feb 2002
Location: on the road
Posts: 2,858
Default

ja
__________________
oi poloi
http://www.memorphic.com/news/
hangalot is offline   Reply With Quote
Old 12-22-2003, 06:33 AM   #6
Stimpson
Flash Safely!
 
Stimpson's Avatar
 
Join Date: Sep 2002
Location: Holland
Posts: 1,092
Default



Zeker weten.
Stimpson is offline   Reply With Quote
Old 12-22-2003, 06:51 AM   #7
hangalot
lala
 
hangalot's Avatar
 
Join Date: Feb 2002
Location: on the road
Posts: 2,858
Default

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...
__________________
oi poloi
http://www.memorphic.com/news/
hangalot is offline   Reply With Quote
Old 12-22-2003, 02:36 PM   #8
Stimpson
Flash Safely!
 
Stimpson's Avatar
 
Join Date: Sep 2002
Location: Holland
Posts: 1,092
Default

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 .
Stimpson is offline   Reply With Quote
Old 12-23-2003, 07:00 PM   #9
hangalot
lala
 
hangalot's Avatar
 
Join Date: Feb 2002
Location: on the road
Posts: 2,858
Default

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?
__________________
oi poloi
http://www.memorphic.com/news/
hangalot is offline   Reply With Quote
Old 12-24-2003, 06:22 AM   #10
Stimpson
Flash Safely!
 
Stimpson's Avatar
 
Join Date: Sep 2002
Location: Holland
Posts: 1,092
Default

Quote:
any ideas?
I'm not sure, what are you trying to achieve exactly? .
Stimpson is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:22 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.