开发者

Flex 4 IntelliJ IDEA wrapper html crashes browser

I'm building an Flex 4 application using IntelliJ IDEA 9.0.2 generated sample Flex application. I replace the generated mxml with the following code from the book Hello Flex 4. It simply crashes the browser when I run it. It says "Waiting for fpdownload.adobe.com..." and then crashes! I tried it on both FF 3.5.9 and Chrome 4.

Any clues?

    [Bindable]
    public var _bread:Number = Number.NaN;
    ]]></fx:Script>
<fx:Declarations>
    <s:RadioButtonGroup id="moralityRBG"/>
    <s:RadioButtonGroup id="restaurantRBG"
            selectedValue="{_theory.length % 2 == 0 ? 'smoking' : 'non'}"/>        
</fx:Declarations>
<s:Panel width="100%" height="100%" title="Simple Components!">
    <s:layout>
        <s:HorizontalLayout paddingLeft="5" paddingTop="5"/>
    </s:layout>
    <s:VGroup>
        <s:TextArea id="textArea" width="200" height="50" text="@{_theory}"/>
        <s:TextInput id="textInput" width="200" text="@{_theory}"/>
        <s:HSlider id="hSlider" minimum="0" maximum="11"
                   liveDragging="true" width="200" value="@{_bread}"/>
        <s:VSlider id="vSlider" minimum="0" maximum="11"
                   liveDragging="true" height="50" value="@{_bread}"/>
        <s:Button label="{_theory}" width="200" color="{alarmTB.selected ? 0xFF0000 : 0}"
                  click="_bread = Math.min(_theory.length, 11)"/>
        <s:CheckBox id="checkBox" selected="{_bread % 2 == 0}" label="even?"/>
    </s:VGroup>
    <s:VGroup>
        <s:RadioButton label="Good" value="good" group="{moralityRBG}"/>
        <s:RadioButton label="Evil" value="evil" group="{moralityRBG}"/>
        <s:RadioButton label="Beyond" value="be开发者_如何学Pythonyond" group="{moralityRBG}"/>
        <s:RadioButton label="Smoking" value="smoking" group="{restaurantRBG}"/>
        <s:RadioButton label="Non-Smoking" value="non" group="{restaurantRBG}"/>
        <s:ToggleButton id="alarmTB" label="ALARM!"/>
        <s:NumericStepper id="numericStepper" value="@{_bread}"
                          minimum="0" maximum="11" stepSize="1"/>
        <s:Spinner id="spinner" value="@{_bread}"
                   minimum="0" maximum="11" stepSize="1"/>
    </s:VGroup>

</s:Panel>


I got the clue. Its the two-way data bindings in action that used to work fine with Flex4-beta but break in Flex4-Final - according to the author Peter Armstrong :-)

Errata for the book is listed in this link

http://www.peterarmstrong.com/?p=214

You may need to remove the @ sign from every control except TextArea and HSlider.

-SiM

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜