PDA

View Full Version : problem with swc files from my custom fla's


Yuhjn
06-14-2009, 02:25 PM
I have an fla which has several library items with a class linkage to a GenericButton.as file. I am exporting this fla as an swc file, and linking that swc into flex.

My problem is that when flex builds the code for GenericButton it gets undefined property for anything it tries to reference that is part of the library item.

Example:

GenericButton.as does libLabel.text = "something"; where libLabel is a textfield, instantiated in the library clip which is bound to GenericButton in it's class linkage.

The field exists in the clip, but when I compile in Flex with the swc in there, it cant find it. It says libLabel doesnt exist, undefined property.

What am I missing here? I want to allow the fla author to bind some of his items to low-level component classes like that, and it's his job to ensure that all the necessary items are part of it. So if he makes a new button, he must just ensure he has a libLabel textfield somewhere in the clip.

Why cant flex see that the items it's trying to compile have a libLabel in there? Is there a work around?

Yuhjn
06-14-2009, 09:53 PM
I have created a simple project to illustrate the problem.

To see the error, just compile in builder. Then you can open the fla to see my export settings.

33378

Yuhjn
06-15-2009, 02:08 AM
problem solved:

Problem was the items that were crashing the compile were defined on the class, not the base class.

The fix was to define public fields in the base class code that had names that exactly matched the members in the library clips. The AS3 just took care of them and filled them out for me.

Whew...