[flexcoders] A question about stage resizing

2010-02-19 Thread Rohit Sharma
Hello All,

I have a question about the way stage resizing occurs in flex.

Please consider the two scenarios :-

i)   In Flash CS3, I gave my application a stage size of 800 * 950. The
application has two screens , first one being 800 * 600 and
 second one being 800 * 950. In the html file I have provided the width
and height as 100%. Now, when I move from screen 1 to screen 2,
 I am not seeing a scroll bar. The second screen comes as cropped.

ii) Whereas in Flex, I provide my application width and height as 100% and
html width and height also as 100%. I am using a viewstack whose
   height and width also is 100% and inside the viewstack I have individual
canvas for each screens. First canvas is of height 600 and second canvas
   is of height 950. In this case I am able to see scroll bars when I move
from first screen to second screen.

  I am not able to see why its not happening in CS3 whereas its happening in
Flex.
Looking for some pointers.

Thanks,
Rohit


Re: [flexcoders] Re: A question about stage resizing

2010-02-19 Thread Rohit Sharma
Hi George,

 i) The screen resolution was 1024 * 768 pixels.

ii)  Width is 800 pixels for both the screens. The height increases from 600
to 950 pixels.
 the 600 px screen looks fine and the 950 px screen comes cropped.

I guess I have answered your questions.
Looking for some suggestions.

Thanks,
Rohit

On Fri, Feb 19, 2010 at 8:26 PM, GeorgeB grg_b...@yahoo.com wrote:



 Hi Rohit,

 Let's clear out some few details:
 You say:

 1. *The application has two screens , first one being 800 * 600 and
  second one being 800 * 950. In the html file I have provided the
  width and height as 100%. Now, when I move from screen 1 to screen  2, I
 am not seeing a scroll bar. The second screen comes as cropped.
 *
 Q. What is your actual screen resolution at the time? (I mean the one your
 system is setup for?)

 2. *First canvas is of height 600 and second canvas
  is of height 950.
 *
 Your screen setup in the first place is *Width* 800pix by *Height* 600pix
 and in the second is *Width* 950pix by *Height* 800pix

 So, what is that you think it's happening?

 Thanks

 George


 --- In flexcoders@yahoogroups.com, Rohit Sharma rohit.sharma1...@...
 wrote:
 
  Hello All,
 
  I have a question about the way stage resizing occurs in flex.
 
  Please consider the two scenarios :-
 
  i) In Flash CS3, I gave my application a stage size of 800 * 950. The
  application has two screens , first one being 800 * 600 and
  second one being 800 * 950. In the html file I have provided the width
  and height as 100%. Now, when I move from screen 1 to screen 2,
  I am not seeing a scroll bar. The second screen comes as cropped.
 
  ii) Whereas in Flex, I provide my application width and height as 100%
 and
  html width and height also as 100%. I am using a viewstack whose
  height and width also is 100% and inside the viewstack I have individual
  canvas for each screens. First canvas is of height 600 and second canvas
  is of height 950. In this case I am able to see scroll bars when I move
  from first screen to second screen.
 
  I am not able to see why its not happening in CS3 whereas its happening
 in
  Flex.
  Looking for some pointers.
 
  Thanks,
  Rohit
 
  



Re: [flexcoders] papervision

2010-01-04 Thread Rohit Sharma
When I was searching for tutorials, these are the two tutorials which I
really liked :


http://blog.tartiflop.com/2008/09/first-steps-in-papervision3d-part-8-movie-materials/

http://www.marcpelland.com/2009/01/22/guide-to-getting-started-in-papervision-3d/3/

On Mon, Jan 4, 2010 at 10:13 PM, thomas parquier 
mailingli...@web-attitude.fr wrote:



 I used papervision once or twice. I used tutorials and online documentation
 :

- http://pv3d.org/ (many simple tutorials)
-
http://papervision3d.googlecode.com/svn/trunk/as3/trunk/docs/index.html


 thomas parquier
 ---
 http://www.web-attitude.fr/realisations/
 msn : thomas.parqu...@web-attitude.fr
 softphone : sip:webattit...@ekiga.net sip%3awebattit...@ekiga.net
 téléphone portable : +33601 822 056


 2010/1/4 mindblast7_7 mindblast...@yahoo.com



 hello everyone!

 i am a php programmer and i need to learn papervision in order to get a
 job. in my country the situation is critical and it goes worst.

 i need some help from you, anyone that knows papervision, if can send me
 some documentation, or send me some links, tutorials ,pdf anything.

 and the most important...someone who can tell me where to start (i must
 mention that i dont know any AS2, or AS3), i dont know if i need to know AS
 before papervision. i also need to know what to learn , how much, what to
 install...everything.

 the bad part is that i need to learn it very quick because i have less
 time. if anyone can help me with this, with advices to, i am glad to
 listten.

 thanks, and sory for this


  



Re: [flexcoders] Passing values from popup window to MXML component

2009-11-09 Thread Rohit Sharma
  You can add a logout button at the same place as login button and toggle
the visibilities of these buttons depending upon the
   state of your component.



On Mon, Nov 9, 2009 at 9:58 AM, Funand Learning
funandlearni...@yahoo.comwrote:



 Hello All,

 I was trying to create a login Page. The page has one main MXML application
 file with couple of MXML components. The First component contains the
 following:

 Component1.mxml:

 ?xml version=1.0 encoding=utf-8?

 width=60% height=261

 mx:Script
 ![CDATA[
 import mx.managers.PopUpManager;
 import mx.controls.Alert;
 import components.LoginPopUp;
 import mx.events.CloseEvent;

 public var loginWin:LoginPopUp;

 private function loginHandler():void {
 loginWin = new LoginPopUp();
 loginWin.addEventListener(CloseEvent.CLOSE,closeHandler);
 PopUpManager.addPopUp(loginWin,this,true);
 PopUpManager.centerPopUp(loginWin);

 }

 public function closeHandler(event:CloseEvent):void
 {
 PopUpManager.removePopUp(loginWin);

 }


 public function checkCredentials():void{

 if(loginWin.userInput.text=='funandlearning' 
 loginWin.passwordInput.text=='funandlearning')
 {
 Alert.show(Login Successful);

 }
 else
 {
 Alert.show(Login Failed);
 }
 }


 ]]
 /mx:Script



 mx:HBox width=90% height=55 borderColor=#F85023
 id=headerButtons
 borderStyle=outset horizontalAlign=left verticalAlign=middle
 backgroundColor=#938480
 mx:Spacer width=10%/
 mx:Button id=loginMain label=Login click=loginHandler()/
 mx:Button id=logout label=LogOut /
 /mx:HBox

 mx:HBox width=100% height=82%
 mx:HBox width=25% height=82% borderStyle=outset
 borderColor=#F85023
 /mx:HBox
 mx:HBox width=65% height=82% borderColor=#F85023
 borderStyle=outset
 /mx:HBox
 /mx:HBox
 /mx:VBox

 component2.mxml has the following code for the popup

 ?xml version=1.0 encoding=utf-8?

 xmlns:main=components.* layout=vertical
   title=Please login showCloseButton=true

 !-- defined state to toggle between register and login --
 mx:states
 mx:State name=Register basedOn=
 mx:AddChild relativeTo={loginForm}
  position=lastChild creationPolicy=all
 mx:FormItem label=Email
 mx:TextInput id=email/
 /mx:FormItem
 /mx:AddChild

 mx:SetProperty target={loginButton} name=label
 value=Register/
 mx:RemoveChild target={registerLink}/

 mx:AddChild relativeTo={linkSpacer} position=before
 mx:LinkButton label=Return to Login
 click=currentState='';this.title='Please Login'/
 /mx:AddChild
 /mx:State
 /mx:states
 mx:Script
 ![CDATA[
 import mx.events.CloseEvent;
 import mx.managers.PopUpManager;
 import mx.controls.Alert;


 ]]
 /mx:Script
 mx:Form id=loginForm
 mx:FormItem label=Username:
 mx:TextInput id=userInput/
 /mx:FormItem
 mx:FormItem label=Password:
 mx:TextInput id=passwordInput displayAsPassword=true/
 /mx:FormItem

 /mx:Form
 mx:ControlBar
  mx:LinkButton
 label=Need to Register? id=registerLink
 click=currentState='Register';this.title='Register'
 /
 mx:Spacer width=100% id=linkSpacer/
 mx:Button label=Login id=loginButton
 click=checkCredentials()/
 mx:Button label=Cancel click=PopUpManager.removePopUp(this)/
 /mx:ControlBar

 /mx:TitleWindow

 I need help in knowing how to change the login button in component1.mxml to
 logout button when the login functionaility from the popuup window is
 successful

 Thanks.

  



Re: [flexcoders] Preventing SWF from dis-assembling

2009-09-14 Thread Rohit Sharma
 I am not sure Nitrolm will help.

  I think I was not clear in mail. The problem is while we are hosting the
application on our web server.
  Once the swf gets downloaded at client side, it can be disassembled.I want
to prevent that.


On Mon, Sep 14, 2009 at 10:14 PM, Jeffry Houser j...@dot-com-it.com wrote:




  Nitrolm.com

 Rohit Sharma wrote:



 Hello All,

  We are working on a commercial application being built on Flex 3.0
 framework.
 Recently we noticed that the swf can be easily dis-assembled and the code
 and the components can be retrieved.
 Please suggest ways to prevent this or make it harder.
 I have read that one way is obfuscation but that only makes the code
 hard to read.
 So, I am not too keen about obfuscating the code.

 Looking for replies.

 Thanks,
 Rohit


 --
 Jeffry Houser, Technical Entrepreneur
 Adobe Community Expert: 
 http://tinyurl.com/684b5hhttp://www.twitter.com/reboog711  | Phone: 
 203-379-0773
 --
 Easy to use Interface Components for Flex 
 Developershttp://www.flextras.com?c=104
 --http://www.theflexshow.comhttp://www.jeffryhouser.com
 --
 Part of the DotComIt Brain Trust

  



[flexcoders] Preventing SWF from dis-assembling

2009-09-14 Thread Rohit Sharma
Hello All,

 We are working on a commercial application being built on Flex 3.0
framework.
Recently we noticed that the swf can be easily dis-assembled and the code
and the components can be retrieved.
Please suggest ways to prevent this or make it harder.
I have read that one way is obfuscation but that only makes the code
hard to read.
So, I am not too keen about obfuscating the code.

Looking for replies.

Thanks,
Rohit


Re: [flexcoders] Re: Measuring the width of a label

2009-07-28 Thread Rohit Sharma
  But measureText() or measureHTMLText() will measure the width of the whole
text
  after considering the current styles for the component. So, it will take
care of different
  letters as well as different fonts.

On Tue, Jul 28, 2009 at 12:07 AM, valdhor valdhorli...@embarqmail.comwrote:



 The problem you are going to face is that different fonts have different
 widths for different characters. For example, an i is thinner than an o.
 You could try using a fixed width font and then counting characters.


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 ivansebastiansurya ivansebastiansu...@... wrote:
 
  Hi everyone,
 
  I'm having a problem regarding measuring the width of a Label control.
  In my item renderer, I need to display a list of labels, but the number
 of labels per row depends on how many of them fit within one row.
  To do that, I need to actually measure the width of the label created
 prior to being added as a child of my renderer.
  Anyone has any idea how to do that?
 
  I need something like:
 
  var label:Label = new Label();
  label.text = Test label;
  // Then I need to measure the width of the created label.
 
  Cheers and thanks in advance for reading my post.
 
  Ivan.
 

  



Re: [flexcoders] getStyleDefinition

2009-07-22 Thread Rohit Sharma
  Hi,

 I am not sure about Flex 4 SDK. But earlier in Flex 3 SDK, I was using
StyleManager.getStyleDeclaration(component)
  to access styles for a particular component.
I hope it helps.

 Regards,
 Rohit

On Tue, Jul 21, 2009 at 2:26 PM, Julian Tenney 
julian.ten...@nottingham.ac.uk wrote:



 Hi,

 Maybe someone can shed some light on this.

 I need to get at runtime a list of styles a particular component
 supports. I am using the Flex 4 SDK.

 I have read about ComponentClass.getStyleDefinition() but cannot get it
 to work. I see this is a method inherited from UIComponent, but it
 always returns undefined if I trace UIComponent.getStyleDefinition

 Is this a Flash only feature or is it also in Flex? Am I missing
 something?

 Is there any other way of getting a list of supported styles for a
 component class?

 many thanks,

 Jules

 This message has been checked for viruses but the contents of an attachment
 may still contain software viruses, which could damage your computer
 system:
 you are advised to perform your own checks. Email communications with the
 University of Nottingham may be monitored as permitted by UK legislation.

  



Re: [flexcoders] Re: Timeline actionscript in embedded MovieClips

2009-07-17 Thread Rohit Sharma
   Hi Max,

 http://jessewarden.com/2006/08/flash-9-button-in-flex-2.html

 The above link might help. It has helped me a great deal in
embedding flash
  symbols in flex. It does the same thing by defining an external class for
the symbol.

  Regards,
  Rohit

On Fri, Jul 17, 2009 at 5:25 PM, Max Pimm m...@alwayssunny.com wrote:



 Hi,

 I have associated an external class that extends movie clip to my symbol in
 flash and in the contstructor of the associated class i paint some
 personalized graphics onto my symbol.

 In flash this works fine and i see the symbol plus the personalized
 graphics.

 However if i embed the symbol in flex it seems that the associated external
 class is stripped just as the timeline actionscript was.

 Just to make sure i also tried referencing the externalized class directly
 in flex instead of embedding the symbol but, logically, it creates an
 instance of the class without linking it to the asset in my swf.

 Am i missing something? Should what i'm doing work?

  



Re: [flexcoders] Timeline actionscript in embedded MovieClips

2009-07-16 Thread Rohit Sharma
   Hi Max,

  When a flash symbol gets embedded in flex, all the associated
action code gets removed.
   You can define an external class for this symbol,which extends movieclip
and then use that
   class in flex.

   Regards,
   Rohit

On Thu, Jul 16, 2009 at 2:40 PM, Max Pimm m...@alwayssunny.com wrote:



 An easy one i hope

 I am embedding a movie clip within a flex Image component.

 mx:Image source=@Embed(source='/swf/assets.swf',
 symbol='symbolWithTimeline')/

 My symbolWithTimeline is a movie clip that has a stop(); in the actions
 of its first frame.

 However when loaded into my flex app flashplayer does not take any
 notice of this command and the MovieClip just loops infinitely.

 I realize that i can control the playhead of the MovieClip using the
 content property of Image however can i not code actions into my
 embedded MovieClips?

  



[flexcoders] Antialiasing true removing characters

2009-07-10 Thread Rohit Sharma
Hi All,

 I am using an embedded font in my application. I am using
advancedantialiasing to show sharper digits.
But using advancedAntiAliasing as true is removing . (U+002E) character.

So, when advancedAntiAliasing is false 7...45 is printed as 7...45
but changing advancedAntiAliasing to true
makes it 745 removing all the dots.

  Has somebody else also faced a similar problem?

Regards,
Rohit


[flexcoders] Invalid data error while embedding symbols from external Swf

2009-07-03 Thread Rohit Sharma
Hello All,

   Till now I have been successfully working by embedding movieclips
from external swf in my flex application.
But now I am facing a weird error. I have to create a form which contains
these embedded movieclip symbols.
As soon as the form comes up I get the run time error saying  The swf
contains invalid data.
I dont know what is creating this issue. I have been searching
google but the only solution I got was to remove
any code on the timeline (which I do not have) and convert any jpeg to
lossless gif/png ( have done that for all the bitmap
even though my form does not use any of them). But still the issue is not
going. I have also tried shifting the respective
symbols at the origin but no result.
   Has somebody faced similar error before? Please provide me some
pointers. Its driving me mad

Thanks,
Rohit


Re: [flexcoders] Application in Full Screen

2009-06-14 Thread Rohit Sharma
  Hi,

If I am right, you are looking for something like

   Application.application.stage.displayState =
StageDisplayState.FULL_SCREEN;


  Regards,
  Rohit

On Sun, Jun 14, 2009 at 6:04 PM, christophe_jacquelin 
christophe_jacque...@yahoo.fr wrote:



 Hello,

 How to set an application in Full screen (without the navigator buttons) ?

 Thank you,
 Christophe,

  



Re: [flexcoders] Re: FilterFunction creating duplicate items in the list

2009-06-03 Thread Rohit Sharma
   Hi All,

 I think I am able to solve the problem.
   The issue was that at every updates I was modifying the dataprovider
which was cast as array collection.
   Once filter is applied the arraycollection keeps only the filtered rooms.
So, even though a room might be
   present in the unfiltered source array, it will get added to the
dataprovider if it was not present in the filtered
   dataprovider.
To remove this, I have changed my update code to change the
underlying array rather than modifying
   the arraycollection.

   Thanks,
Rohit

On Tue, Jun 2, 2009 at 8:50 AM, Tim Hoff timh...@aol.com wrote:



  I update the corresponding item in the dataprovider using setItemAt. (I
  typecast dataprovider as Arraycollection).
  Recently I added some filters to the room list using
  filterfunction. As soon as I start applying filters, I see few items
 getting
  duplicated in the list. Some items exist with old values as well as new
  values.

 Ok, so your indexes are not synchronized; returned data is getting set on
 the wrong items.  How are you determining the correct index when using
 setItemAt()?  If you're storing the position index when the ArrayCollection
 is un-filtered, and then filtering, the old index may not be the same as the
 new index in the filtered ArrayCollection.  You can loop through the
 ArrayCollection and check the item's id field against the updated return
 item:
 *

 public
 * *function* getRoomResult( newRoomVO : RoomVO ) : *void
 *{
 * for* *each* ( *var* oldRoomVO : RoomVO *in* rooms )
  {
 *  if* ( newRoomVO.id == oldRoomVO.id )
   {
rooms.setItemAt( newRoomVO, getItemIndex( oldRoomVO ) );
 *   return*;
   }
  }
 }

 However, this wouldn't update any items that were not included in the
 ArrayCollection, because of a filter.  Updating the source Array itself
 would also do the trick.  But, you would have to re-cast the
 ArrayCollection after an update.

 Just a few thoughts,
 -TH


 --- In flexcoders@yahoogroups.com, Tim Hoff timh...@... wrote:
 
 
  Sounds like your itemRenderer might not be clearing out old data
  correctly. Check out Question 2 in Amy's FAQ:
 
  http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf
  http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf
 
  -TH
 
  --- In flexcoders@yahoogroups.com, Rohit Sharma rohit.sharma1982@
  wrote:
  
   Hi All,
  
   I am stuck up with this problem. Please provide some insight into
   it.
  
I have a list component which shows all the game rooms currently
  existing.
   As soon as some property of the room changes,
   I update the corresponding item in the dataprovider using setItemAt.
  (I
   typecast dataprovider as Arraycollection).
   Recently I added some filters to the room list using
   filterfunction. As soon as I start applying filters, I see few items
  getting
   duplicated in the list. Some items exist with old values as well as
  new
   values.
   I also tried making the filtering and updating actions mutually
   exclusive using flags hoping that two different actions taking
   place on the same data might cause duplication of items. But the
  duplication
   is still taking place.
   In fact I tried using itemUpdate() also in place of setItemAt but the
   problem still persists.
   I have also tried modifying only the source array during updates
  because the
   filtering takes place only on the ArrayCollection and
   not on the source array but this also failed.
  
   Any inputs will be appreciated.
  
   Thanks,
   Rohit
  
 
  



Re: [flexcoders] FilterFunction creating duplicate items in the list

2009-06-01 Thread Rohit Sharma
  Hi Srinivas,

   I tried using creating a different data provider from the roomlist and
applying filter functions on that.
   And then assigning the filtered dataprovider to the roomlist. But still I
am seeing the issue.
   Can you provide some code snippets for what you mean?

  Thanks,
  Rohit

On Mon, Jun 1, 2009 at 8:12 AM, Srinivas Sandur Madhu Murthy 
s.m.srini...@gmail.com wrote:



 Longtime back I did face similar issue. I probably believe, you have binded
 the array collection with data grid or list directly  applying filter on
 this binded array collection. If it is true, then trying not binding them
 using {}, use flags and commitProperties() method and apply filter
 function if not applied already on collection  then assign dataProvider for
 grid/list. Probably this might remove or resolve duplication problem.

 Srinivas

 On May 31, 2009, at 12:16 PM, Rohit Sharma wrote:

  Hi All,

 I am stuck up with this problem. Please provide some insight into
 it.

  I have a list component which shows all the game rooms currently
 existing. As soon as some property of the room changes,
 I update the corresponding item in the dataprovider using setItemAt. (I
 typecast dataprovider as Arraycollection).
   Recently I added some filters to the room list using
 filterfunction. As soon as I start applying filters, I see few items getting
 duplicated in the list. Some items exist with old values as well as new
 values.
 I also tried making the filtering and updating actions mutually
 exclusive using flags hoping that two different actions taking
 place on the same data might cause duplication of items. But the
 duplication is still taking place.
  In fact I tried using itemUpdate() also in place of setItemAt but the
 problem still persists.
 I have also tried modifying only the source array during updates because
 the filtering takes place only on the ArrayCollection and
 not on the source array but this also failed.

   Any inputs will be appreciated.

 Thanks,
 Rohit


  



[flexcoders] FilterFunction creating duplicate items in the list

2009-05-31 Thread Rohit Sharma
Hi All,

I am stuck up with this problem. Please provide some insight into
it.

 I have a list component which shows all the game rooms currently existing.
As soon as some property of the room changes,
I update the corresponding item in the dataprovider using setItemAt. (I
typecast dataprovider as Arraycollection).
  Recently I added some filters to the room list using
filterfunction. As soon as I start applying filters, I see few items getting
duplicated in the list. Some items exist with old values as well as new
values.
I also tried making the filtering and updating actions mutually
exclusive using flags hoping that two different actions taking
place on the same data might cause duplication of items. But the duplication
is still taking place.
 In fact I tried using itemUpdate() also in place of setItemAt but the
problem still persists.
I have also tried modifying only the source array during updates because the
filtering takes place only on the ArrayCollection and
not on the source array but this also failed.

  Any inputs will be appreciated.

Thanks,
Rohit


Re: [flexcoders] Re: problems embedding symbols from Flash

2009-05-26 Thread Rohit Sharma
Will this help?

   http://jessewarden.com/2006/08/flash-9-button-in-flex-2.html

I use flash movieclip symbols in flex by linking to an external AS class and
provide the symbol functionality in that class only.

Regards,
Rohit

On Tue, May 26, 2009 at 11:05 PM, a.scavarelli a.scavare...@yahoo.comwrote:



 Is the symbol exported for actionscript in it's properties? And if so is
 the name amp_ok? or is it something like someclass.amp_ok?

 I could not ever figure out how to link a symbol to an external as class
 and use it's extended functionality in Flex. I ended up just creating a
 component with all the external as within teh script tags.

 Hopefully it's an easy fix like this for you :)


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
 grimmwerks gr...@... wrote:
 
  Frustrated.
 
  I've got tried this with an AS3 version and currently with a Flash
  player 8 version... but am trying to embed a class within a component
  like so:
 
  [Bindable]
  [Embed(source=buttonStates/multistate8.swf, symbol=amp_ok)];
  private var tmp:Class;
 
  I get Metadata requires an associated definition
 
  The component is on the same level of buttonStates, so it's not a path
  issue; when I've attempted to test the flash file with a Button and
  using symbol as skins, it works no problem...\
 
  Thoughts?
 

  



[flexcoders] Scrolling a text in text input when textalign is set to right

2009-05-21 Thread Rohit Sharma
Hi,

In a text input, if the text align property is set to right, the text
doesn't get scrolled automatically.
The scrolling only happens if you select the text using mouse and then drag
the mouse.
It does not scroll even with arrow keys.
 This bug is also reported for flex SDK.
http://bugs.adobe.com/jira/browse/SDK-17418
http://bugs.adobe.com/jira/browse/FP-2079
  The bug also mentions a workaround. But I am not able to use that
workaround.
Can anyone help me with the bug or with the workaround?

Thanks,
Rohit


Re: [flexcoders] Re: Scrolling a text in text input when textalign is set to right

2009-05-21 Thread Rohit Sharma
Hi Steve,
 Its not working. While I am typing the text shifts as left aligned.
This being a right to left chat application, I cant let it happen.

Thanks,
Rohit

On Thu, May 21, 2009 at 6:31 PM, valdhor valdhorli...@embarqmail.comwrote:



 Something like this should work...

 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 mx:Style
 FormItemLabel
 {
 textAlign: left;
 }
 /mx:Style
 mx:Script
 ![CDATA[
 private function
 setLeftAlignmentWhileTyping(event:KeyboardEvent):void
 {
 if(ti3.getStyle(textAlign) == right)
 {
 ti3.setStyle(textAlign, left);
 }
 }
 ]]
 /mx:Script
 mx:Form
 mx:FormItem label=textAlign = left:
 mx:TextInput id=ti1 text=left textAlign=left /
 /mx:FormItem
 mx:FormItem label=textAlign = center:
 mx:TextInput id=ti2 text=center textAlign=center /
 /mx:FormItem
 mx:FormItem label=textAlign = right:
 mx:TextInput id=ti3 text=right textAlign=right
 keyUp=setLeftAlignmentWhileTyping(event)
 focusOut=ti3.setStyle('textAlign', 'right') /
 /mx:FormItem
 /mx:Form
 /mx:Application

 All it does is set the textAlign to left if someone is typing into the
 field and then resets textAlign to right when they are done.



 HTH



 Steve

 --- In flexcoders@yahoogroups.com, Rohit Sharma rohit.sharma1...@...
 wrote:
 
  Hi,
 
  In a text input, if the text align property is set to right, the text
  doesn't get scrolled automatically.
  The scrolling only happens if you select the text using mouse and then
 drag
  the mouse.
  It does not scroll even with arrow keys.
  This bug is also reported for flex SDK.
  http://bugs.adobe.com/jira/browse/SDK-17418
  http://bugs.adobe.com/jira/browse/FP-2079
  The bug also mentions a workaround. But I am not able to use that
  workaround.
  Can anyone help me with the bug or with the workaround?
 
  Thanks,
  Rohit
 
  



Re: [flexcoders] Re: Scrolling a text in text input when textalign is set to right

2009-05-21 Thread Rohit Sharma
Sorry for being vague about my requirements.
The chat component is an Arabic chat component (RTL text).
Hence the text is right text aligned. When we start typing in the text
input, once the
text input gets filled we are not able to see any further text provided by
user. It does not
get scrolled automatically to the new insertion position. If you want to see
the text you have
to select it using mouse and then drag it.
  Just try this by setting the text align property to right and start
filling the text input.
Once it gets filled you wont be able to see what you are inputting next.

Hope this helps.

Thanks,
Rohit

On Fri, May 22, 2009 at 12:12 AM, valdhor valdhorli...@embarqmail.comwrote:



 What is a right to left chat application ?

 Can you point me at an example of how it's meant to work?


 --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Rohit
 Sharma rohit.sharma1...@... wrote:
 
  Hi Steve,
  Its not working. While I am typing the text shifts as left aligned.
  This being a right to left chat application, I cant let it happen.
 
  Thanks,
  Rohit

  



[flexcoders] Selected Item getting scrolled to the top

2009-03-26 Thread Rohit Sharma
Hi All,
 In my application I have a list component which shows list of all the
possible games currently going on.
What is happening is that when I select a particular game, it automatically
gets scrolled to the top during the next update.
And then it becomes really difficult for the user to scroll up or down.
Because even if I scroll up or down, the selected item
gets scrolled to the top of the list. I think scrolling of the list should
not be affected by the selection of an item.
   Is it the natural behavior of Flex? If yes, any tips to overcome this
behavior.

Thanks,
Rohit Sharma,
Co-Founder and Lead Developer, Mactabilis Arts,
www.mactabilisarts.com


[flexcoders] Sorting a list at specified intervals

2009-03-23 Thread Rohit Sharma
Hello All,

 I have a requirement in my project where I want the list to be
sorted every three seconds. The flow goes as follows :-


   1. As soon as a new room gets added or deleted or the user count changes,
   it gets reflected in the room list which is a list component.
   2. But the room list should be sorted only on 3 seconds duration.

 What is happening is that as soon as I apply the sort and refresh
it, it starts working. And the sorting happens as soon as some change
   happens to the list dataprovider. Am not able to restrict the sort at
three seconds interval. I have also tried using disableautoupdate with
   the data provider but that stops the addition of the new rooms also.
I also tried setting sort to null after applying first sort but as soon as
   I refresh the null sort, original sort goes off.

   Please help, I am stuck with this thing.

 Regards,
 Rohit Sharma
 Lead Developer, Mactabilis Arts.
 www.mactabilisarts.com