Setting constraint values inside states

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default Setting constraint values inside states

    Hi all, in the code attached I have a state called 'pods1' - I have a canvas
    called pod1 when I'm in design view and I change states to 'pods1' it works
    fine - but if I change to this state programatically it says 'left' can't be
    found in <mx:canvas> object? in design view it can see the paramater and in
    code it can't seems strange

    Any help much appreciated.


    <mx:states>
    <mx:State name="pods1">
    <mx:SetProperty target="{pod1}" name="left" value="col1:5"/>
    <mx:SetProperty target="{pod1}" name="top" value="row1:5"/>
    <mx:SetProperty target="{pod1}" name="right" value="col2:5"/>
    <mx:SetProperty target="{pod1}" name="bottom" value="row4:8"/>
    </mx:State>

    SWT62 Guest

  2. Similar Questions and Discussions

    1. Get controls values upon auto-postback of another control inside DataGrid
      Hi This is edited from post from a while back, there's still something I need to find an answer for (boy datagrids are a headache when you first...
    2. Attributes on a class to generate parameter values inside XML node
      I might have the terms wrong, I'm an XML newbie, but here is what I need to do: I am returning an object in a webservice. public class Profile...
    3. setting variables inside a php class
      I am trying to change the value of a variable inside a class from one of its functions rather than the constructor, but it doesn't seem to work. ...
    4. setting the input inside a asp page.
      Hello! Was thinking of having an array inside a asp page. I'm rather new to this. How do I begin. my asp page should work as follows: 1. One...
    5. Setting values in an asp:dropdownlist
      I have a page that allows users to create a user account. The aspx has various dropdowns that I populate by binding the dropdownlist to a...
  3. #2

    Default Re: Setting constraint values inside states

    I'm assuming you can't use this type of state change with constraint based
    layout?

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Canvas id="pod1" x="1" y="1" backgroundColor="#ffccee">
    <mx:Button x="10" y="10" label="Change to pods1 State"
    click="currentState='pods1'"/>
    <mx:Button x="10" y="40" label="Change to Base State"
    click="currentState=''"/>
    </mx:Canvas>
    <mx:Canvas id="pod2" x="1" y="200"
    left="10" right="200" backgroundColor="#ccffee">
    <mx:Button x="10" y="170" label="Change to pods2 State"
    click="currentState='pods2'"/>
    <mx:Button x="10" y="200" label="Change to Base State"
    click="currentState=''"/>
    </mx:Canvas>
    <mx:states>
    <mx:State name="pods1">
    <mx:SetProperty target="{pod1}" name="x" value="20"/>
    <mx:SetProperty target="{pod1}" name="y" value="20"/>
    </mx:State>
    <mx:State name="pods2">
    <mx:SetProperty target="{pod2}" name="left" value="20"/>
    <mx:SetProperty target="{pod2}" name="right" value="20"/>
    </mx:State>
    </mx:states>
    </mx:Application>

    Greg Lafrance Guest

  4. #3

    Default Re: Setting constraint values inside states

    Thanks for the prompt reply Greg, your examples proves I'm not going mad then!

    Is this an omission or by design - do you think?

    Thanks
    SWT
    SWT62 Guest

  5. #4

    Default Re: Setting constraint values inside states

    If it is true that there is no way to do this, I would think it would a design error.
    Greg Lafrance Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139