How to use a flex custom component in an AS3 Class?
Copy link to clipboard
Copied
Our software team has been developing flash applications using AS3 (via the FlashDevelop IDE and the free Flex SDK). Recently, some members of the team started exploring FlexBuilder and Flex (wow... why did we wait so long?). The problem is that some folks continue to develop using pure Action Script 3 (FlashDevelop) while others are creating custom components in FlexBuilder.
How do the AS3 developers use the Flex Custom components built in FlexBuilder in their AS3 Applications?
Copy link to clipboard
Copied
You could do otherwise, use in Flex the AS3 libraries

Copy link to clipboard
Copied
You can do it by creating a SWC and imporing it to flash in the design time,
Or you can look for the AS3 classes flex Builder generates and import them in your code.
I am not too sure a bout the facts above but I heard that this can be done easily.
Copy link to clipboard
Copied
SwapnilVJ,
Your suggestions enabled me to make progress, but I'm still having a problem. Based on you suggestion, I learned how to make a swc using Flex Builder. I successfully added the swc to the lib resource in my AS3 project (FlashDevelop). I was able to instantiate one of my new components (code hinting even picked it up from the lib).
When I run my app, my component is not visible. I can trace properties of it and the values are correct. Any thought why I might not be seeing my custom component?
package trainer.games.board.MatchThree {
import flash.display.Sprite;
public class Test extends Sprite{
private var cp:MatchingGameControlPanel; // <<< this is my swc custom component created in Flex
public function Test() {
cp = new MatchingGameControlPanel();
cp.visible = true;
addChild(cp);
trace("width: ",cp.width); // <<< works and displays valid data for the component.
}
}
}

Copy link to clipboard
Copied
If yo have used say Accordian in your SWC from flex.
Then you will need to have SWC for Accordian to be placed in your flash Library.
That might be one of the problems.
Copy link to clipboard
Copied
Still no joy. I've tried adding:
framework.swc
flex.swc
rcp.swc
utilities.swc
from the skd /frameworks/libs directory, to my library build path in FlashDevelop but I'm still having the same problem.

Copy link to clipboard
Copied
I am helpless here
I don't have Flex bulder installed on my system. I will let you know if I got something related to your querry.
Copy link to clipboard
Copied
Thanks for your efforts. It's a very frustrating situation.

