Reputation: 53
I'm trying to use Spark components in a Flash Professional CC project. I've added AIR 14 to Flash CC:
and I've adjust my preferences to use Apache Flex SDK and pointed it to paths of Flex additional libraries:
Now, I can add spark components to my project:
import spark.components.Button;
var btn:Button = new Button();
btn.label = "Test";
btn.x = 300;
btn.y = 300;
this.addChild(btn);
but when I run it, it doesn't show them. What it's wrong?
PD: Sorry about my poor English
Upvotes: 1
Views: 321
Reputation: 2223
Spark components cannot be used in a Flash CC project. Those components are meant to be initialized by a Flex system of managers (style, css, etc) and never directly created by the coder himself. They can only work within a mxml based project where initialization of components is deferred and handled by those managers. In fewer words, spark components have been made to work exclusively in Flex based projects and there's no direct way to use them in Flash projects.
Upvotes: 2