7 Replies Latest reply on Oct 21, 2009 1:36 PM by Jerry62712

    Why is the results moving down?

    Jerry62712 Level 1

      I have an application with two states. One includes an input form and the other has the results of the computations of that data. I do a removechild for the input fields and an addchild to put in the results.

      Somehow I'm getting a margin at the top of the results page. It is about 3/4" so it is very noticeable. Because (I'm guessing) I position to the first result field (a textInput that is not editable), the page positions with the above margin (or whatever is causing it) and half the top banner off the top of the page.

      1) any ideas of how to isolate the problem?
      2) any ideas of how to fix the problem?

        • 1. Re: Why is the results moving down?
          Subeesh Arakkan Level 4

          Are you  using absolute layout for the application?. If so check the "y" or "top" properties of the result form

          • 2. Re: Why is the results moving down?
            Jerry62712 Level 1

            I'm using absolute positioning on the application.  The first state has a header component followed by a title followed by a text box followed by a form.  Below that is two more components.

             

            When the user clicks the calcualte button, the stuff in the form is removed and replaced with the results of the calculation.  The header component is now 3/4" moved down.  I have a margin around the SWF object and it is white while the stuff in the SWF page is a brown/grey.  The 3/4" is also brown/grey so I know the header component is moved down.

             

            I don't see a "top" option for the component.

             

            Thanks for looking at this.

             

            Jerry

            • 3. Re: Why is the results moving down?
              Subeesh Arakkan Level 4

              can you paste the code here?, It will be easy for us to understand the issue .

              • 4. Re: Why is the results moving down?
                Jerry62712 Level 1

                This is the code, hopefully enough to show the problem.  Attached are two (poor color) gifs to show it.

                <?xml version="1.0" encoding="utf-8"?>
                <mx:Application
                  xmlns:mx="http://www.adobe.com/2006/mxml"
                  xmlns:DHSComp="components.*"
                  initialize="setInitAccessible();"
                  applicationComplete="setInitLanguage();"
                  backgroundColor="#dedacf"
                  layout="absolute"
                  paddingLeft="5"
                  paddingRight="5"
                  height="100%"
                  verticalScrollPolicy="on">

                ...

                  <mx:states>
                    <mx:State name="Result">
                      <mx:RemoveChild target="{fsPageTitleNoticePanel}"/>
                      <mx:RemoveChild target="{fsPageTitleNoticeVBox}"/>

                 

                      <mx:RemoveChild target="{householdInformationCanvas}"/>
                      <mx:RemoveChild target="{householdInformationPanel}"/>
                      <mx:RemoveChild target="{householdInformationVBox}"/>

                 

                      <mx:RemoveChild target="{incomeAndAssetsCanvas}"/>
                      <mx:RemoveChild target="{incomeAndAssetsPanel}"/>
                      <mx:RemoveChild target="{incomeAndAssetsVBox}"/>

                 

                      <mx:RemoveChild target="{expensesCanvas}"/>
                      <mx:RemoveChild target="{expensesPanel}"/>
                      <mx:RemoveChild target="{expensesVBox}"/>

                 

                      <mx:RemoveChild target="{standardUtilityAllowanceCanvas}"/>
                      <mx:RemoveChild target="{standardUtilityAllowancePanel}"/>
                      <mx:RemoveChild target="{standardUtilityAllowanceVBox}"/>

                 

                      <mx:RemoveChild target="{calculateButton}"/>
                      <mx:RemoveChild target="{resetButton}"/>

                 

                      <mx:RemoveChild target="{accessibility}"/>
                      <mx:RemoveChild target="{resultButton}" />

                 

                      <mx:AddChild relativeTo="{bodyFormHolder}" position="firstChild">
                        <mx:VBox id="resultsPageBox"
                            backgroundColor="#dedacf"
                            width="100%"
                            verticalScrollPolicy="off" horizontalScrollPolicy="off">
                            <mx:Canvas id="rAccessibility"
                                width="100%" >
                                <mx:HBox id="rAccessHBox"
                                    minWidth="640" width="100%"
                                    x="0" y="0">
                                    <mx:VBox id="rAccessSizeFontVBox"
                                        width="160">
                                        <mx:HBox id="rHSliderFontHBox"
                                            width="100%">
                                            <mx:HSlider
                                                id="rSizeFontIndex"
                                                labels="['0','1','2','3','4','5','6']"
                                                toolTip=" "
                                                liveDragging="true"
                                                maximum="6"
                                                snapInterval="1"
                                                minimum="0"
                                                change="changeFontSize();"
                                                tickInterval="1"
                                                showDataTip="true"
                                                visible="true"
                                                tickThickness="3"
                                                width="100%"
                                                tabIndex="10" />
                                        </mx:HBox>

                 

                                        <mx:HBox id="rAccessSizeFontLabelHBox"
                                            width="100%">
                                            <mx:Label id="rAccessFontSizeLabel"
                                                width="100%"
                                                textAlign="center"
                                                text=" " />
                                        </mx:HBox>
                                    </mx:VBox>

                 

                                    <mx:VBox id="rAccessContrastBoxLabel">
                                        <mx:HBox id="rHSliderContrastHBox">
                                            <mx:HSlider
                                                id="rContrastIndex"
                                                labels="['Normal','High']"
                                                toolTip=" "
                                                liveDragging="true"
                                                maximum="1"
                                                snapInterval="1"
                                                minimum="0"
                                                change="changeContrast();"
                                                tickInterval="1"
                                                showDataTip="true"
                                                tickThickness="3"
                                                width="1%"
                                                tabIndex="15"/>
                                        </mx:HBox>
                                        <mx:HBox id="rAccessContrastHBox"
                                            width="100%">
                                            <mx:Label id="rAccessContrastLabel"
                                                styleName="textNormal"
                                                width="100%"
                                                textAlign="center"
                                                text=" " />
                                        </mx:HBox>
                                    </mx:VBox>

                 

                                    <mx:HBox id="rPageButtonBox"
                                        horizontalAlign="right"
                                        width="100%">
                                        <mx:Button id="rLanguageSwitchButton"
                                            label="{pageButtonLanguage}"
                                            rollOverEffect="{glowButton}"
                                            click="swapLanguage()"
                                            toolTip=" "
                                            tabIndex="5" />
                                    </mx:HBox>
                                </mx:HBox>
                            </mx:Canvas>

                ...

                <mx:VBox id="windowWorkspace"
                    backgroundColor="#dedacf"
                    height="100%"
                    width="100%">

                 

                <!-- ********************************************************************** -->
                <!-- ** header area ******************************************************* -->
                    <DHSComp:DHSHeader id="headerComp"
                        SNAPText="{pageSNAPText}" />

                 

                <!-- ********************************************************************** -->
                <!-- ** start of the form area ******************************************** -->
                  <mx:Canvas id="formHolder"
                    minWidth="650"
                    width="100%"
                    backgroundColor="#dedacf">

                 

                    <mx:Text id="fsPageTitle"
                        text="{pageTitleText}"
                        styleName="pageTitle"
                        width="100%"
                        textAlign="center" />

                 

                    <mx:Form id="bodyFormHolder"
                        minWidth="640"
                        width="100%"
                        y="33">
                        <mx:Canvas id="accessibility"
                            width="100%" >
                            <mx:HBox id="accessHBox"
                                minWidth="640" width="100%"
                                x="0" y="0">
                                <mx:VBox id="accessSizeFontVBox"
                >
                                    <mx:HBox id="hSliderFontHBox"
                                        width="100%">
                                        <mx:HSlider
                                            id="sizeFontIndex"
                                            liveDragging="true"
                                            maximum="6"
                                            snapInterval="1"
                                            minimum="0"
                                            labels="['0','1','2','3','4','5','6']"
                                            toolTip=" "
                                            change="changeFontSize();"
                                            tickInterval="1"
                                            showDataTip="true"
                                            visible="true"
                                            tickThickness="3"
                                            width="100%"
                                            tabIndex="10"/>
                                    </mx:HBox>
                                    <mx:HBox id="accessSizeFontLabelHBox"
                                        width="100%">
                                        <mx:Label id="accessFontSizeLabel"
                                            width="100%"
                                            textAlign="center"
                                            text="Text Size" />
                                    </mx:HBox>
                                </mx:VBox>

                 

                • 5. Re: Why is the results moving down?
                  Subeesh Arakkan Level 4

                  Hi,

                  I could not  run the pasted code as it is missing some essential parts

                  • 6. Re: Why is the results moving down?
                    Jerry62712 Level 1

                    I only sent the code that was involved.  I've attached the application as a zip file that should work.

                    • 7. Re: Why is the results moving down?
                      Jerry62712 Level 1

                      Magic happens.  I now am not getting the spacing at the top of the page resulting in the application moving down the page.  There was a set of code setting properties that I don't remember ever putting in.  I deleted those lines and it is working OK now.