Flex Component Kit for Flash CS3: Compile problems

For the last few months i have been successfully using the Flex Component Kit For Flash CS3 to export timeline based animations and various other bits as Flex Components – niceness. Today I have struck a problem, one I am surprised I have not struck previously. Basically, i create my component in flash, select the [...]

For the last few months i have been successfully using the Flex Component Kit For Flash CS3 to export timeline based animations and various other bits as Flex Components – niceness.

Today I have struck a problem, one I am surprised I have not struck previously. Basically, i create my component in flash, select the convert to flex component command, then publish – all good. Next i change the linkage from mx.flash.UIMovieClip to a custom class, one that extends UIMovieClip. Usually this step is also fine, however if the custom class imports any class that in turn inports a non-flash class, e.g. Cairngorm classes from a library, or ArrayCollection I get compile errors.

I guess that makes sense, just curious that I have not encountered previously. Any suggestions on ways to work around this would be appreciated!!

 

4 Responses to “Flex Component Kit for Flash CS3: Compile problems”

  1. This is very interesting.

  2. Joeflash says:

    I gather you are getting compile errors in Flash when you attempt to compile the SWC? If this is the case, it’s because the Flash compiler has no way of accessing the Flex SDK. Your best best is to employ just those features you need from Flash in your custom UIMovieClip, such as graphics and timeline states, and extend that class in Flex for your “final” component, which will enable you to have access to the Flex SDK without CEs.

  3. [...] Vivace from New Zealand raises an interesting problem, exactly the same one as I’m having. He is authoring UIMovieClips in [...]

  4. Joeflash says:

    The reason for this is that the Flex Component Kit only contains the mx.flash.* package, which contain no direct dependencies to the Flex framework beyond a few interfaces in this package. So ArrayCollections don’t work. And databinding metadata is from the Flex compiler. So as a rule, don’t use anything in ‘CustomClass extends UIMovieClip’ that is not in mx.flash.* or the AS3/Flash API.

    The solution is easy enough.

    If you have a CustomClass asset in the FLA library which extends UIMovieClip in CustomClass.as, make sure it does not contain any flex-specific behaviour. In Flex, create a subclass of CustomClass as your final component, such as ‘FlexCustomClass extends CustomClass’, and add your Flex-specific behaviour in that class. FlexCustomClass will be compiled by the Flex compiler and thus have access to the Flex SDK.

Leave a Reply



Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...