Re: [Flashcoders] Error in Flex for automatically created classes

2008-02-26 Thread Jason Van Cleave
a couple of ways i use

1. Export a swc from your fla and Flex can use the classes in it

2. Load a complied swf at runtime and use getDefinition

http://livedocs.adobe.com/labs/flex3/langref/flash/system/ApplicationDomain.html#includeExamplesSummary

On Tue, Feb 26, 2008 at 8:49 AM, Johan Nyberg <[EMAIL PROTECTED]>
wrote:

> 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
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Error in Flex for automatically created classes

2008-02-26 Thread Johan Nyberg
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