Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to use a flex custom component in an AS3 Class?

New Here ,
May 27, 2009 May 27, 2009

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?

TOPICS
ActionScript
860
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 27, 2009 May 27, 2009

You could do otherwise, use in Flex the AS3 libraries

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 27, 2009 May 27, 2009

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 28, 2009 May 28, 2009

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.
  
  }
 
}

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 31, 2009 May 31, 2009

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 01, 2009 Jun 01, 2009

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 01, 2009 Jun 01, 2009

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 02, 2009 Jun 02, 2009
LATEST

Thanks for your efforts.  It's a very frustrating situation.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines