Hi, I'm using Flex as an IDE for Flash development. When I instanciate Movie Clips in Flash that are inheriting from a base class, but that do not have a class of their own (i.e. the class is automatically created) I get an error in Flex. I understand that it's because the class does not exist, but is there a way around it? Or do I have to create a class skeleton for every Movie Clip that is dynamically created?

Here is the function where I create movie clips from the library by using information from an XML. All the clips have Column as their base class):

                public function createColumns( _xml:XML ):void
                {
                        for each( var column:XML in _xml.columns.* )
                        {
                                var clip:Column;

                                switch( column.name.toString() )
                                {
                                        case 'pokerRoom':
                                                clip = new PokerRoom();
                                                break;  
                                        case 'us':
                                                clip = new Us();
                                                break;  
                                        case 'bonus':
                                                clip = new Bonus();
                                                break;  
                                        case 'roomReviews':
                                                clip = new ReadReview();
                                                break;  
                                        case 'getBonus':
                                                clip = new Button();
                                                break;  
                                }
                                clip.x = column.x;
                                clip.y = column.y;

                                addChild( clip );
                        }
                }


Regards,

Johan Nyberg
Designer and web developer

[EMAIL PROTECTED]
08 - 50 00 24 30
070 - 407 83 00



_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to