corrected bugs introduced in flash target

Because js.* packages cannot imported. Conditional compilation used