English 中文(简体)
Flex - 视图更改后 RichText 编辑器失去外观样式
原标题:Flex - RichTextEditor losing styling after view change

灵活 RichText 编辑器中似乎有一个错误, 在改变观点( 查看状态变化) 时, RTE 丢失了格式。 有人以前遇到过这个问题, 并知道如何解决这个问题 。 任何帮助都会非常感激 。

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx"
               minWidth="955" minHeight="600" xmlns:base="ui.components.base.*" xmlns:ui="ui.*" xmlns:local="*">

    <fx:Script>
        <![CDATA[
            import mx.events.FlexEvent;

            protected function click_clickHandler(event:MouseEvent):void
            {
                trace(this.rte.htmlText);
                this.currentState = "other";

            }

            protected function clickother_clickHandler(event:MouseEvent):void
            {
                this.currentState = "normal"
            }
        ]]>
    </fx:Script>
    <s:states>
        <s:State name="normal"/>
        <s:State name="other"/>
    </s:states>

    <s:VGroup includeIn="normal">
        <mx:RichTextEditor id="rte">

        </mx:RichTextEditor>
        <s:Button id="click" x = "500" y = "500" click="click_clickHandler(event)">

        </s:Button>
    </s:VGroup>

    <s:VGroup includeIn="other" >
        <s:Label>
            test
        </s:Label>
        <s:Button id="clickother" click="clickother_clickHandler(event)">
        </s:Button>
    </s:VGroup>
</s:Application>
问题回答

我面对了这个问题,解决办法是采用外部风格。

表示视图被修改时, cs 适用于正则。

祝你今天过得愉快...





相关问题
Disable button tooltip in AS3

I want to disable the tooltip on certain buttons. The tooltip manager seems to be an all or nothing solution. Is it possible to disable the tooltip for just one or two buttons?

Multiple Remote call made simultenously

I was making multiple remote calls and they are done sequentially and when I am getting a result event back it s triggering calls to all the methods with ResultEvent as an argument . I am supposed to ...

Attaching a property to an event in Flex/AS3

I have a parameter that needs to be passed along with an event. After unsuccessful attempts to place it on the type by extending the class, I ve been advised in another SO question to write a custom ...

Clearing RSL in Cache

I have built a flex application which has a "main" project and it is assosciated with a few RSL s which are loaded and cached once i run my "main" application. The problem i am facing is that the ...

What s a good way of deserializing data into mock objects?

I m writing a mock backend service for my flex application. Because I will likely need to add/edit/modify the mock data over time, I d prefer not to generate the data in code like this: var mockData =...

AS3 try/catch out of memory

I m loading a few huge images on my flex/as3 app, but I can t manage to catch the error when the flash player runs out of memory. Here is the what I was thinking might work (I use ???? because i dont ...

热门标签