Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 03-09-2007, 03:19 PM   #1
astgtciv
Resu Deretsiger
 
astgtciv's Avatar
 
Join Date: Jul 2005
Location: St-Petersburg, Russia
Posts: 2,329
Default Runtime Creation of Components

Alright, I feel really silly that after 2.5 years of doing Flash I still don't know how to do this (or even if it's possible). All my searching has been in vain. Today I decided that I must find out the answer to this.

How do I instantiate a component (e.g., a RadioButton) dynamically from AS, but not from another component - just attaching it to a movieclip? Somehow I just can't seem to find the answer to this!!!
__________________
overstream.net: add subtitles to online videos (youtube, vimeo, blip.tv...).
astgtciv is offline   Reply With Quote
Old 03-13-2007, 04:55 AM   #2
astgtciv
Resu Deretsiger
 
astgtciv's Avatar
 
Join Date: Jul 2005
Location: St-Petersburg, Russia
Posts: 2,329
Default

Amazing, it's not just me then? Nobody knows the answer to this question? Wow, this is like The Great Actionscript Conspiracy!
__________________
overstream.net: add subtitles to online videos (youtube, vimeo, blip.tv...).
astgtciv is offline   Reply With Quote
Old 03-13-2007, 07:21 AM   #3
anandkanatt
Registered User
 
Join Date: Jan 2007
Posts: 19
Default

can u explain your question ??
is it that u want to initialise a UI object dynamically??
it can be done using
Code:
createClassObject(className, instanceName, depth, initObject)


Regards
Anand
anandkanatt is offline   Reply With Quote
Old 03-13-2007, 07:40 AM   #4
astgtciv
Resu Deretsiger
 
astgtciv's Avatar
 
Join Date: Jul 2005
Location: St-Petersburg, Russia
Posts: 2,329
Default

Wow, I tried it and it did work! I swear I tried this at least 5 times before and it didn't work! Probably the first couple of times it was because I didn't have the component in the library, but I could swear I went through this process before. Damn! Somehow I came to the conclusion that createClassObject was a method of UIObject/UIComponent and could not be invoked from a MovieClip.

Thanks, Anand, this really made my day.
__________________
overstream.net: add subtitles to online videos (youtube, vimeo, blip.tv...).
astgtciv 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Runtime code creation astgtciv ActionScript 3.0 6 07-25-2006 02:05 AM
Why do components take so long to appear on stage? xbrotherx Components 3 06-21-2006 04:00 PM
Runtime components initialize slow greyerlynx ActionScript 2.0 3 11-15-2005 06:25 PM
Dynamic creation of components ekeland ActionScript 1.0 (and below) 0 08-30-2005 03:29 PM
Adding Custom Components at Runtime djsodom ActionScript 2.0 3 02-27-2005 08:29 PM


All times are GMT. The time now is 10:19 AM.

///
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.