Hi,

I am currently working on the issue about StageTextInput not scrolling on 
mobile:
https://issues.apache.org/jira/browse/FLEX-33166


Debugging the SDK  source code,  it appears that "proxying" the StageTextInput 
with a bitmap is already in place (see class StyleableStageText).

However, the proxy bitmap is shown  in only very specific situations:
- a stage animation that contains the stage text is playing (example:  Touch 
"throw" animation, that happens when you *release* your finger after swiping )
- popup is opened , in which case all text input below in the z-order are 
proxied to bitmaps

Another rather "radical" approach, which has been suggested by some ( 
DarkStone, Flexicious), would be to always display a StageText as a proxy 
bitmap when it's visible, 
and to show the StageText only when typing text via the soft keyboard.

It's hard for me to believe that the Adobe SDK team went into all the pain of 
implementing the bitmap proxying, and the complex popup depth calculations (cf. 
StyleableStageText 3000+ lines of code) and didn't think about such a simple 
approach.
So there must be something else!

Some ideas come to mind:
- memory concerns: maintaining bitmap proxies for all visible text inputs (and 
text areas), especially on high resolution displays, can be very costly. 
- time:  maybe Flex was stopped at Adobe before this approach could be 
implemented, and TI was left in an intermediate state...

Or maybe, they didn't see the scrolling issue... nobody is perfect.

Does someone know ?

Maurice 

-----Message d'origine-----
De : DarkStone [mailto:darkst...@163.com] 
Envoyé : mercredi 30 octobre 2013 08:26
À : dev@flex.apache.org
Objet : Re:Re: Re:Air Stage Text Issue

Hi Naveen,

I haven't got time to implement it yet.

But I figure it out a better solution:

1. Create a class named "VisualStageText" which extends SpriteVisualElement 
class and implements IEditableText interface.

2. In the VisualStageText class implementation, define a private variable 
stageText:StageText, use it to implement IEditableText yourself, and also 
define a private variable snapshot:Bitmap.

3. Listen for VisualStageText instance's Event.ACTIVATE, Event.DEACTIVATE, 
MouseEvent.ROLL_OVER, MouseEvent.ROLL_OUT and other interaction relative events 
to detect user interactions.

4. When the user is currently interacting with VisualStageText, you need to 
hide the snapshot and show the stageText:
snapshot.parent ? removeChild(snapshot) : null; snapshot.bitmapData.dispose(); 
snapshot.bitmapData = null; stageText.stage = stage; stageText.viewPort = new 
Rectangle(...);

5. When the user is not interacting with VisualStageText, you need to take a 
snapshot of the stageText, then hide the stageText and display the snapshot:
var bd:BitmapData = new BitmapData(stageText.viewPort.width, 
stageText.viewPort.height); stageText.drawViewPortToBitmapData(bd);
snapshot.bitmapData = bd;
stageText.stage = null;
addChild(snapshot);

Well this is it, this is the core concept of how to do a Flex version 
StageText, you can use the VisualStageText as a MXML tag, and bind it to the 
skinpart of the spark TextInput (or TextArea)'s textDisplay:IEditableText.

I plan to implement my VisualStageText at the end of this year, but if you 
can't wait you can do it by yourself, good luck : )


DarkStone
2013-10-30
At 2013-10-30 01:44:33,Naveen2803 <naveen.malhotr...@gmail.com> wrote:
>Hi DarkStone,
>
>Thank you for your post.
>
>Can you please share the code for the same as I am little confused on 
>how to achieve this.
>
>Thanks is Advance
>
>
>
>--
>View this message in context: 
>http://apache-flex-development.2333347.n4.nabble.com/Air-Stage-Text-Iss
>ue-tp30223p31670.html Sent from the Apache Flex Development mailing 
>list archive at Nabble.com.

Reply via email to