0

For some reason, when I use package_as3 in FlasCC I can't import any classes to use as a var.

package_as3
(
    "#package private\n"
    "import flash.system.MessageChannel;\n"
    "var mc:MessageChannel;\n"
);

When I try to build anything that has this code in it, I get this:

Error: Type was not found or was not a compile-time constant: MessageChannel.

whenever I use the compiled SWC in Flex.

EDIT:

This doesn't just apply to flash.system.MessageChannel; it seems to happen to anything that gets imported.

ketan
  • 19,129
  • 42
  • 60
  • 98
ShadowFan-X
  • 131
  • 1
  • 2

1 Answers1

0

A few things to try out

Syntax

I don't think you are supposed to wrap each line in quotes, nor add \n for string termination, so that's one thing that need mending.

SDK

The MessageChannel class requires SDK version 4.6 and above so did you select the correct SDK and add it to your buildpath?

Runtime

Also the MessageChannel interface did not get run-time support until version 14.0.0 (AIR or Player), so in project properties -> ActionScript Compiler, did you set the 'Require Flash Player Version' to version 14.0 or above?

visibleman
  • 3,175
  • 1
  • 14
  • 27
  • Sorry, I missed the fact that you were using FlasCC, not just Flex. Still, I will leave the answer up in-case there is anything there that will put you on the right track. – visibleman Jul 17 '14 at 00:22