Skip navigation
zhangbaoustc
Currently Being Moderated

tlf2.0 float(flex 4.0 update for tlf2.0)

Aug 2, 2010 5:49 AM

I do as the article Flex4 updates for tlf2.0, but  when i use float attribute such as "left" or "right" ,the image will disappear,

 

1. load the sdk 4.0.14159

2. replace the the files (FTETextField.as    and      csstextLayoutFormat.as);

3. replace the textLayout.swc in the framework

 

4.run ant -q main

 

then I set the flashbuilder 4's sdk with the sdk I just changed.

 

Do i miss something or i do something wrong?

the <img />  float="left" or "right" the img is disappear, but there is no compiler error or runtime errors.

 
Replies
  • Currently Being Moderated
    Aug 2, 2010 12:34 PM   in reply to zhangbaoustc

    I had to do one additional step, which was to set the Framework linkage in the Properties for the application under "Flex build path" to "Merged Into Code".

     

    The new list features aren't working correctly when accessed via mxml -- I will submit a fix for this.

     

    I wrote a very simple back to basics application that does work, can you try it? Also, if this app works, can you post your application that doesn't work? My best guess is that the problem has to do with the connection to Flex, and once we can repro it here it may be easy to fix. I'll add another mxml application that is working for me.

     

    Thanks,

     

    - robin

     

     

    package
    {
        import flash.display.Graphics;
        import flash.display.Sprite;
        import flash.geom.Rectangle;
       
        import flashx.textLayout.container.ContainerController;
        import flashx.textLayout.elements.InlineGraphicElement;
        import flashx.textLayout.elements.ParagraphElement;
        import flashx.textLayout.elements.SpanElement;
        import flashx.textLayout.elements.TextFlow;
       
        public class Test extends Sprite
        {
            public function Test()
            {
                var s:Sprite = new Sprite();
                s.x = 100;
                s.y = 100;
                addChild(s);
               
                var span:SpanElement = new SpanElement();
                span.text = "Hello";

     

                var ilg:InlineGraphicElement = new InlineGraphicElement();
                var inline:Sprite = new Sprite();
                inline.graphics.beginFill(0xFF0000);
                inline.graphics.drawRect(0, 0, 100, 100);
                inline.graphics.endFill();
                ilg.source = inline;
                ilg.float = "left";

     

                var paragraph:ParagraphElement = new ParagraphElement();
                paragraph.addChild(span);
                paragraph.addChild(ilg);
               
                var textFlow:TextFlow = new TextFlow();
                textFlow.addChild(paragraph);
                textFlow.flowComposer.addController(new ContainerController(s, 600, 600));
                textFlow.flowComposer.updateAllControllers();
            }
           
        }
    }

     

    Here's the mxml one:

     

    <?xml version="1.0" encoding="utf-8"?>
    <Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                 xmlns="library://ns.adobe.com/flex/spark"
                 xmlns:local="*"
                 xmlns:ai="http://ns.adobe.com/ai/2009"
                 xmlns:d="http://ns.adobe.com/fxg/2008/dt"
                 xmlns:flm="http://ns.adobe.com/flame/2008"
                 height="600" width="800">
        <fx:Script><![CDATA[       
            import flashx.textLayout.conversion.ConversionType;
            import flashx.textLayout.conversion.TextConverter;
            import flashx.textLayout.elements.TextFlow;
           
            public function traceContent():void
            {
                trace(TextConverter.export(myRET.content as TextFlow, TextConverter.TEXT_LAYOUT_FORMAT, ConversionType.STRING_TYPE));
            }
        ]]>
        </fx:Script>
       
        <RichEditableText id="myRET" click="traceContent()" height="100" width="200">
            <content>
                <p><span id="span1">This is span 1.</span><img float="left" width="100" height="100" source="gremlin.jpg"/></p>
            </content>
        </RichEditableText>
    </Application>

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 2, 2010 5:35 PM   in reply to zhangbaoustc

    Sounds like it. We'll investigate and see if we can duplicate your results and fix. Thanks!

     

    - robin

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 5, 2010 1:35 AM   in reply to zhangbaoustc

    Hi Zhangboustc,

     

    I too came across this error. The problem in my case was that I tried to recompile the flex 4.1 sdk with the new changes for TLF 2, which worked, but on using it in an application it produced the same error :

     

         TypeError: Error #1034: can't converter  GlobalSWFContext@7315fc1 to mx.core.IFlexModuleFactory。

     

    When I recompiled the 4.0 sdk, I did not have this error. You might want to check if you recompiled the 4.0 sdk (not the 4.1) and that you actually replaced the 2 classes that are necessary for your custom sdk build. If you compare the old and the new classes you will see that some of the changes regard GlobalSwfContext and IFlexModuleFactory typing.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 5, 2010 9:37 AM   in reply to Tim@Edge

    Hi,

     

    Make sure you turn off RSLs.  From the Properties for your project Select "Flex Library Build Path", select the "Library Path" panel and change the "Framework linkage" to "Merged into code".

     

    Hope that helps,

    Richard

     
    |
    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