PDA

View Full Version : one variable 2 classes problem


bauhaus
11-05-2008, 05:58 PM
Hi,
do you guys have any idea why it doesn't work:
*code was corrected*

if (test == 1) {var clip_mc:classA = new classA();}
else {var clip_mc:classB = new classB();}



Flash returns error:
1151: a conflict exists with definition in namespace internal

I'm trying to use diffrent classes depending on user languague - parameter is passed via flashvars. Actionscript 3.0 naturally.

Thanks

palmjack
11-05-2008, 06:10 PM
var clip_mc:classB = classB();
I guess it should be
var clip_mc:classB = new classB();

bauhaus
11-05-2008, 06:19 PM
It was just a typo, there is other problem. In my code naturally there is "new" statment.
Best

bauhaus
11-05-2008, 07:08 PM
Why inside IF statement there can't be alternative instance declaration?
Compiler obviously doesn't like it.
Any ideas?