all groups > flash actionscript > august 2006 >
You're in the

flash actionscript

group:

Creating instances of custom components in Actionscript


Re: Creating instances of custom components in Actionscript araujo.lucas NO[at]SPAM gmail.com
8/12/2006 4:26:38 PM
flash actionscript:
[quoted text, click to view]


Drag a instance to library, then write this to create a DataGrid
component:

this.createClassObject("DataGrid", "Grid", gridDepth);
Creating instances of custom components in Actionscript everynewday
8/12/2006 6:19:56 PM
I'm trying to create an instance of a custom component. My component shows up
in the components panel, and I can drag an instance on to the stage, but how do
I create an instance of a custom component in Actionscript?
Re: Creating instances of custom components in Actionscript araujo.lucas NO[at]SPAM gmail.com
8/13/2006 9:27:21 AM
[quoted text, click to view]


Sorry, I was wrong. The first parameter isn't a String, but a Function.
And I forgot to declare the "import" statement. micahkoga samples is
correct...

Source:
http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?href=00004190.html
Re: Creating instances of custom components in Actionscript micahkoga
8/13/2006 2:30:48 PM
This is some code to attach a button component. I would assume your custom
component would work similarly.



import mx.controls.Button;
createClassObject(Button,"button2",5,{label:"Test Button"});
AddThis Social Bookmark Button