Skip to main content
markerline
Inspiring
July 16, 2013
Question

is it possible to combine FLA, AS3, and Flex?

  • July 16, 2013
  • 2 replies
  • 3965 views

Hi.  I have a concept for using assets created in the Flash GUI and stored as Library elements in the Flash GUI but accessed and manipulated via AS3?  The issue I have is the concept has to be developed in Flash Builder/Flex 4.7 so I'm trying to figure out if there's a way to export each FLA library element using some kind of automated process that will enumerate each object for easy scripting access via an AS3 Array or Array Collection in Flex.

Any examples on this?  Thanks in advance.

This topic has been closed for replies.

2 replies

Inspiring
July 17, 2013

Second thought re enumeration.

You don't need JSFL. Just write a class that will contain an instance of array of library instances --> create SWC --> use instance of the class that has array to read values in Flex.

markerline
Inspiring
July 17, 2013

Just to clarify, Andrei.  ..

How would I create enumerated Library objects in the Flash IDE before compililng my SWC without having to manually add them to the library?  Is there a batch command for adding multiple items simultaneously?  I can work with Flash CS4 through Flash CC.

Inspiring
July 18, 2013

Hi.  Maybe you can help me with this part.  I have successfully added 313 items to the Library and Stage.  I have converted each automatically using JSFL that I found online to a Movie Clip with unique numerical name (begins with the word "Symbol" e.g. Symbol_1_mc and have successfully used the command to convert to Flex component.

I published a SWC with the Publish settings option and now have a file (example name "MyComponents001.swc" and have placed this in a new Flex Project in Flash Builder 4.7 into the libs folder.  However I get an error in the Problems view which says definition libs.MyComponents001.swc could not be found.  I used the import statement in the fx:Script part "import libs.MyComponents001.swc;" without the quotes and then tried to create a for loop to add each element to the canvas automatically. 

I get a blank canvas.

I don't think I'm working with the SWC properly.  Perhaps there is online documentation which can teach me how to do this correctly?  Thanks in advance.


This is a bit confusing.

What do you expect to accomplish by the directive "import libs.MyComponents001.swc;"?

Import directive is used to map packages or classes. SWC is neither one. SWC is a library that has (or is supposed to have) packages.

This means that if SWC does not have top level package and all classes are in the same top level - you do not need to use import directive. You will just reference classes directly. For example:

if SWC contains class Symbol_1_mc you will instantiate this class like that:

var symbol1:Symbol_1_mc = new Symbol_1_mc();

This is if symbols in SWC are linked to their corresponding classes.

Other than that it is not possible to help unless there is more info about how classes are structured in the SWC.

Inspiring
July 17, 2013

If you need to use objects created in Flash IDE as library in other dev environment - just compile SWC from the FLA that contains these objects and use this SWC as an external library in Flash Builder or any other IDE. As far as enumeration goes - perhaps you can do something with JSFL but it may be too much trouble. If FLA assets have linkage classes - using them is just a mater of instantiation of these classes which is no different from the standard syntax of creating instances.