Fork me on GitHub
Not signed in (Sign In)

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

    • CommentAuthorRogier21
    • CommentTimeFeb 13th 2009
     
    I am kind of new with Flex 3.2, but I wanted to try the Flint engine.

    I downloaded 2.01, and imported this in a new Flex 3 project.

    I add the code from the Examples, and there are no errors. But when I run the app:

    TypeError: Error #1034: Type Coercion failed: cannot convert org.flintparticles.twoD.renderers::DisplayObjectRenderer@5e1e3a1 to mx.core.IUIComponent.
    at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::addingChild()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\Container.as:3251]
    at mx.core::Container/addChildAt()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\Container.as:2200]
    at mx.core::Container/addChild()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\Container.as:2140]
    at Countdown/init()[C:\Users\Rogier\Documents\Flex Builder 3\Countdown\src\Countdown.mxml:42]
    at Countdown/___Countdown_Application1_creationComplete()[C:\Users\Rogier\Documents\Flex Builder 3\Countdown\src\Countdown.mxml:2]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/dispatchEvent()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:9051]
    at mx.core::UIComponent/set initialized()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:1167]
    at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:698]
    at Function/http://adobe.com/AS3/2006/builtin::apply()
    at mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8460]
    at mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8403]

    Not sure what this means, and how I can solve this?

    Thanks!
    • CommentAuthorRichard
    • CommentTimeFeb 14th 2009 edited
     
    Flex's layout system only works with displayObjects that implement the IUIComponent class. Since DisplayObjectRenderer doesn't implement this class, Flex throws this error. To fix it, you need to wrap the renderer in an object that does implement IUIComponent - Grant Skinner has an example of such a wrapper here.

    I'm currently developing a Flex friendly version of Flint, to be part of the 2.1 release. It's in the flex branch of the svn repository.
    • CommentAuthorRogier21
    • CommentTimeFeb 15th 2009
     
    Perfect, this worked like a charm!

    I wasn't aware of this 'limitation'. Looking forward to 2.1 stable!