1

I created few flex components in flash using flex component kit for flash. It generates a swf and a swc file. my question is, how can i load these flash created flex component at runtime and use them. Thanks

Max
  • 325
  • 4
  • 16

1 Answers1

0

Drop the swc files in your flex project's libs folder (should be next to the src folder in your project).

Your project should automatically pick it up.

You can then check the Reference Libraries in your Package Explorer under FB to see what it gets imported as.

In one of my project I had a map created in flash, exported as a TheMap swc component through Flash Catalyst - but the process should similar with Flash components, maybe using a different namespace.

See screenshot..

alt text

I can use the component by importing flashy.TheMap

Check what the doc says regarding namespaces for the flex component kit.. but you probably can guess it by exploring the swc through the Referenced Libraries

Ben
  • 20,737
  • 12
  • 71
  • 115
  • I'm actually looking for a way to load them at runtime via xml file. Is there any possibility of that? – Max Jan 12 '11 at 02:44
  • What would be the benefits? It's gonna be a pain to do I reckon.. this separate thread may help you http://www.actionscript.org/forums/showthread.php3?t=180162 – Ben Jan 12 '11 at 03:01
  • read this too.. http://stackoverflow.com/questions/164162/flex-graphic-assets-swf-or-swc – Ben Jan 12 '11 at 03:06
  • Thanks, using SWF will solve the matter, now back to the last part, i'm trying to casting flash created flex container in Container, even UIComponent, but it returns null. var flexContainerClass:Class = loader.contentLoaderInfo.applicationDomain.getDefinition("Background") as Class var flexContainer:* = new Square() as UIComponent; – Max Jan 12 '11 at 05:32