I thoroughly have this same issue, but I've noticed it with all layout settings in mx:Application. Is this a bug in Flex 2 Beta 2?


On Mar 25, 2006, at 2:22 PM, Carlos Rovira wrote:

Hi,

I was playing with States and modified the search example from the docs a bit so the application notice browser size changes and I think there's some strange issues with resizing behaviour in IE6 and Firefox1.5.0.1 .

I only add to mx:Application the following:
            width="100%" height="100%" layout="vertical"

And it seems that when I resize the Firefox window in "results" state to a size below the original Firefox width, the panel don't resize to that position.

In IE6 there's no problem with the width, but I notice that resizeEffect is not playing and the panel 'jumps' from one size to the new one.

-----------------------------------

search code with modifications:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" implements="mx.core.IHistoryState "
    creationComplete="initApp()" width="100%" height="100%" layout="vertical">
    <mx:Script>
        import mx.managers.HistoryManager;
        import flash.display.Stage;
       
        /////////////////////////
        // IHistoryState methods
        /////////////////////////
        // Restore the state and searchString value.
        public function loadState(state:Object):void {
            if (state) {
                currentState = state.currentState;
                searchString = searchInput.text = state.searchString;
            }
            else {
                currentState = '';
            }
        }
        // Save the current state and the searchString value
        public function saveState():Object {
            var state:Object = {};
            state.currentState = currentState;
            state.searchString = searchString;
            return state;
        }   
       
        /////////////////////////
        // App-specific scripts
        /////////////////////////
        // The search string value.
        [Bindable]
        public var searchString:String;
       
        // Register the application with the history manager
        // when the application is created.
        public function initApp():void {
            HistoryManager.register(this);
        }
       
        // The method for doing the search.
        // For the sake of simplicity it doesn't do any searching.
        // It does change the state to display the results box,
        // and save the new state in the history manager.
        public function doSearch():void {
            currentState = "results";
            searchString = searchInput.text;
            HistoryManager.save();
        }
        // Method to revert the state to the base state.
        // Saves the new state in the history manager.
        public function reset():void {
            currentState = '';
            searchInput.text = "";
            searchString = "";
            HistoryManager.save();
        }
    </mx:Script>
   
    <mx:states>
        <!-- The state for displaying the search results. -->
        <mx:State name="results">
            <mx:SetProperty target="{p}" name="width" value="100%" />
            <mx:SetProperty target="{p}" name="height" value="100%" />
            <mx:SetProperty target="{p}" name="title" value="Results" />
            <mx:AddChild target="{searchFields}">
                <mx:Button label="Reset" click="reset()" />
            </mx:AddChild>
            <mx:AddChild target="{p}">
                <mx:Label text="Search results for {searchString}" />
            </mx:AddChild>
        </mx:State>
    </mx:states>

     <!--  In the base state, just show a panel with a search text input and button.-->
    <mx:Panel id="p" title="Search" resizeEffect="Resize"
        paddingLeft="5" paddingTop="5" paddingRight="5" paddingBottom="5">
        <mx:HBox id="searchFields" defaultButton="{b}">
            <mx:TextInput id="searchInput" />
            <mx:Button id="b" label="Go" click="doSearch();" />
        </mx:HBox>
    </mx:Panel>
</mx:Application>

--
::| Carlos Rovira
::| http://www.carlosrovira.com


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS





Reply via email to