Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5950741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:26:12+00:00 2026-05-22T17:26:12+00:00

In Flex 3.0, I made a state which has draggable windows (CollapsableTitleWindow code written

  • 0

In Flex 3.0, I made a state which has draggable windows (CollapsableTitleWindow code written by someone else, but that’s irrelevant).

Then, I created a new viewstate, which repositions the windows around a bit.

<mx:State name="newstate" basedOn="firststate">
    <mx:SetProperty target="{window1}" name="width" value="50%"/>
    <mx:SetProperty target="{window2}" name="x" value="{window1.width + 5}"/>

I want to position one window next to the other on load, but I don’t want the second window to move when the user drags the first one around.

How can I bind the x to the value of (window1.width + 5) at load, but then lose the continuous evaluation of the thing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:26:13+00:00Added an answer on May 22, 2026 at 5:26 pm

    You could set the x property in an event listener for one of the state changing events: enterState, exitState, currentStateChange or currentStateChanging.

    Here’s Adobe’s documentation.

    You could try an event handler for the enterState event :

    protected function window1_enterStateHandler(event:FlexEvent):void
    {
      window1.percentWidth = 100;
    }
    

    UPDATE:
    From Tominator’s comments below:

    Alert.show('before: ' + window1.width.toString() + ' pixels, ' + window1.percentWidth.toString() + '%');  
    window1.percentWidth = 50;  
    Alert.show('after: ' + window1.width.toString() + ' pixels, ' + window1.percentWidth.toString() + '%');  
    

    The result is that I get the output:

    before: 458.022705 pixels, NaN%
    after: 458.022705 pixels, 50%

    You may want to try calling window1.validateDisplayList() or validateNow() after setting the percentWidth property.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been given a Flex application which made use of a RESTFUL service. I've
I'm making a flex 3.5a/air2 application and I've made a popup window but I
I have a flex project that is made of up several custom components that
If I made a project with flex, and i want to distribute it, what
Flex has an issue with hyphens in xml. I need to generate an xml
The Flex 3 docs are fairly basic. Can someone post a more complete example
Using Flex 3, I have a Button which is skinned using PNGs specified in
In Flex I'm using the following code to allow sorting in a DataGrid (the
I have made a program in Flex for creating simple schedules, similar to MS
I made a login component for my flex 4 application, and i load this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.