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 6194163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:14:56+00:00 2026-05-24T03:14:56+00:00

I’m using Flex 4.5.1 with AIR 2.7 (and Flash Builder 4.5.1) to build an

  • 0

I’m using Flex 4.5.1 with AIR 2.7 (and Flash Builder 4.5.1) to build an app for the Blackberry Playbook.

The app has a large textarea that needs to be resized when the soft keyboard shows up. I am able to hook into the soft keyboard events and do things there.

Now, I want to resize the textarea to fit the remaining part of the screen when the keyboard shows up. I know the current and destination size and want to use a smooth animation to show the textarea resizing. (I can’t already set the height and can see the textarea being correctly resized in the keyboard_activating event – but I want to do it through an animation). I’ve tried using the Animate class, the spark.effects.Move class and none of them seem to work in this case. They seem to run the animation but the screen does not get refreshed!

I don’t want to use the built-in resizeAppForKeyboard property on the ViewNavigatorApplication. I have set to ‘none’ in the app descriptor so that part of it is fine.

Any ideas / thoughts? Is my approach correct at all? How would one go about resizing the textarea using an animation in the keyboard activating event? My code looks like:

In the main view (onCreationComplete event): (txNote is the textarea in question)

txNote.addEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATE, function(e:SoftKeyboardEvent):void {
    toggleEditMode(true);
});

txNote.addEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_DEACTIVATE, function(e:SoftKeyboardEvent):void {
    toggleEditMode(false);
});

private function toggleEditMode(keyboardActivated:Boolean):void {
    trace("toggle edit: " + editMode + ", kb activating: " + keyboardActivated + ", txNote height = " + txNote.height);

    editMode = keyboardActivated;

    //we handle resize manually, because we want a nice animation happening and we want to resize only the text area - nothing else.
    var y:Number = editMode ? -38 : 0;
    var height:Number = editMode ? 218 : 455;
    txNote.moveAndSize(y, height);
}

The code in txNote.moveAndSize:

public function moveAndSize(newY:Number, newHeight:Number):void {

//parent group uses BasicLayout
//(this.parent as Group).autoLayout = false;
//resizePath.valueFrom = this.height;
//resizePath.valueTo = newHeight;

//movePath.valueFrom = this.y;
//movePath.valueTo = newY;

//resizeEffect.heightFrom = this.height;
//resizeEffect.heightTo = height;

    this.top = newY;
    moveEffect.xFrom = this.x;
    moveEffect.xTo = this.x;

    moveEffect.yFrom = this.y;
    moveEffect.yTo = newY;

    moveEffect.end();
    moveEffect.play([ this ]);

    //this.move(x, newY);
    //animate.play([ this ]);

    //this.height = height;
    //this.y = y;

    //setLayoutBoundsSize(width, height);
    //setLayoutBoundsPosition(x, y);
}

The moveEffect / movePath / animate various things I tried are set up in the txNote constructor as follows:

public class NotesArea extends TextArea {
//      private var animate:Animate;
//      private var movePath:SimpleMotionPath;
//      private var resizePath:SimpleMotionPath;

        private var moveEffect:Move;
//      private var resizeEffect:Resize;

        public function NotesArea() {
            super();

//          animate = new Animate();
//          var paths:Vector.<MotionPath> = new Vector.<MotionPath>();
//          movePath = new SimpleMotionPath("top");
//          resizePath = new SimpleMotionPath("height");
//          paths.push(movePath);
            //paths.push(resizePath);

//          animate.duration = 300;
//          animate.motionPaths = paths;

//          animate.addEventListener(EffectEvent.EFFECT_UPDATE, function(e:EffectEvent):void {
//              trace("y = " + y);
//              invalidateDisplayList();
//          });
//          animate.addEventListener(EffectEvent.EFFECT_END, function(e:EffectEvent):void {
//              trace("EFFECT ended: y = " + y);
//          });

            moveEffect = new Move();
            moveEffect.duration = 250;
            moveEffect.repeatCount = 1;
            moveEffect.addEventListener(EffectEvent.EFFECT_END, function (e:EffectEvent):void {
                //(this.parent as Group).autoLayout = true;
                trace("move effect ran. y = " + y + ", top = " + top);
            });

            //this.setStyle("moveEffect", moveEffect);
//
//          resizeEffect = new Resize();
//          resizeEffect.duration = 250;
//          this.setStyle("resizeEffect", resizeEffect);
        }

}
  • 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-24T03:14:57+00:00Added an answer on May 24, 2026 at 3:14 am
    yourTextField.addEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_DEACTIVATE, onActivating);
    yourTextField.addEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATING, onActivating); 
    yourTextField.addEventListener(SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATE, onActivating); 
    
    // in the event listener to the textField IE : 
    
    private function onActivating(event:SoftKeyboardEvent):void 
    {
      //listen to the event; make your move here.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I've got a string that has curly quotes in it. I'd like to replace
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.