Groups | Blog | Home
all groups > flash actionscript > december 2005 >

flash actionscript : AS 2.0 Classes SIMPLE Tutorial


john.gooch
12/21/2005 9:33:28 PM
I'd like to make a custom UI component that lets consists of a colored
rectangle and a dynamic text box. My goal is to have dynamic text background be
transparent, while the rectagle ( in a layer below the text ) provides the
background color. Then dynamic text would be easily changable via the editor by
have a parameter called "text" exposed, and I would also expose the rectangle's
color as the "bgcolor" parameter.


So far, I have created a symbol out of the two aforementioned components, and
I made an AS file in the Actionscript path. Both the symbol and the as file
have the same name ( different extensions ), and I set the symbol properties to
map is to the Actionscript file.

At this point, I do not know what to put in the action script file to
initialize the component and how to expose the properties. This should be
simple., but so far my googling / help file searching doesn't give me any
examples/guides that are step by step and applicable to what I am looking to do.

Any advice? Links?

Thank You,

John Gooch


john.gooch
12/21/2005 10:43:57 PM
Update: Here is my as file:

class dnCatTitle {
[Inspectable(defaultValue="Text Not Set")]
public var strText:String;
}

I have updated the component several times, and the "inspectable" tag is not
making the propery available in the editor when I create a new instance, is
there a special trick to make this work?

AddThis Social Bookmark Button