Skip navigation
Currently Being Moderated

Error while attempting to use the CSSFormatResolver Class in Flash CS4

Sep 1, 2009 12:07 AM



While trying to work with a revised version of the CSSFormatResolver class (created by timoisalive and posted on this thread) the compiler threw the following error:


1061: Call to a possibly undefined method getChildAtIndex through a reference with static type flashx.textLayout.elements:FlowGroupElement.


The method originates from within the invalidate() method of the CSSFormatResolver class.


public function invalidate(target:Object):void {       

     delete _textLayoutFormatCache[target];      

     var blockElem:FlowGroupElement = target as FlowGroupElement;      

     if(blockElem) {          

          for(var idx:int = 0; idx < blockElem.numChildren; idx++)                          invalidate(blockElem.getChildAtIndex(idx));          




If I comment the for loop I can get the example to run, but that seems to seriously affect the way the styles are interpreted...


The example files are attached below.


Any suggestions?

Thank you in advance.

  • Currently Being Moderated
    Sep 1, 2009 10:48 AM   in reply to H_mike

    There is no FlowGroupElement.getChildAtIndex method.


    There are these two:

    Returns the FlowElement child at the specified index.
    Searches in children for the specified FlowElement object and returns its index position.


    I think you meant getChildAt.


    Hope that helps,


    Mark as:
  • Currently Being Moderated
    Sep 2, 2009 3:00 AM   in reply to H_mike

    Hi guys,


    I didn't actually modify the invalidate method in my version, Adobe's version refers to the getChildAtIndex method.


    My version differs from Adobe's in the way that I am giving the resolver a StyleSheet object instead of having it use the Flex framework StyleManager class to resolve styles.



    Mark as:
  • Currently Being Moderated
    Sep 2, 2009 10:05 AM   in reply to H_mike

    There has been a lot of cleanup and renaming of APIs we do review them constantly to try and make them be consistent and have a natural feel to AS3 developers.  Please check the release notes when you pickup new textLayout.swc versions.  We make every effort to log changes in the release notes.  That said I'm sure there are omissions.


    The most recent examples are posted here including an updated SimpleEditorWithCSS:


    Apologies for the confusion and thanks for putting up with the API shifts.  We really do appreciate your efforts and do want to support you. We're a tad short handed right now for various reasons - but that's all going to get fixed.  Soon I hope!


    I'm especially pleased folks are using the IFormatResolve interface - it wasn't a feature request internally I added it because I thought it would be cool.  Really nice to see it getting leveraged.




    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points