Re: [flexcoders] Help with Timer issue

2009-02-19 Thread Anand Jha
remove listener added to timer from codeonButtonClick/code function.
OR
Just remove the listener when you get the success status within 
codecheckStatus/code function.


 Regards,
KumarA





From: trishhartnett trishhartn...@yahoo.com
To: flexcoders@yahoogroups.com
Sent: Wednesday, February 18, 2009 1:37:32 PM
Subject: [flexcoders] Help with Timer issue


Hello all, 

I'm a Flex newbie. I'm working on an application where an end user
clicks a button, and when the button is clicked a DB is queried
repeatedly until a particular result is returned. When the result is
returned the end user gets a confirmation message to tell them that
they were successful.

So the code goes like this:

private var dBTimer:Timer = new Timer(5000);

private function onButtonClick( ): void{
dBTimer.addEventLis tener(TimerEvent .TIMER, timeTick);
dBTimer.start( );
}

public function timeTick(evt: TimerEvent) :void {
checkStatus( callBackFunction , id); 
}

private function callBackFunction( ):void 
{
if( status == 'SUCCESS' )
{ 
// cancel the timer
dBTimer.stop( ); 
dBTimer.reset( );
Alert.show( Succcess string,Info ,OK,null, null,INFO_ ICON);
}else{
//do nothing and the checkStatus 
//will be called again  at next TimerEvent
} 
}

So the first time the end user clicks on the button, everything works
okay. The DB is queried and when SUCCESS is returned the dBTimer is
stopped and reset. The end user gets the Success Alert dialog box and
everything is okay.

The second time the end user clicks the button, everything happens the
same as before, only the dbTimer, despite being stopped doesn't stop
working. checkStatus is called over and over again in an infinite loop
because the dbTimer never stops.

Can anyone suggest anything please ? I am really puzzled by this one.

Best Regards, 
Trish.


   


  

Re: [flexcoders] HTML Text Scrollbars not showing up

2009-02-18 Thread Anand Jha
Hello!
Instead of using Text component, use TextArea component. May be, you have to 
define the width and height of the text area.





From: Dan Vega danv...@gmail.com
To: flexcoders@yahoogroups.com
Sent: Wednesday, February 18, 2009 11:50:53 AM
Subject: [flexcoders] HTML Text Scrollbars not showing up


I have this popup window that gets created in the main application. When it is 
created its given a size of 500/250. There is more content then what is show 
but I don't see any scrollbars. I tried setting the verticalScrollPolic y to 
true but it just seems like it doesnt calculate the html text correctly. What 
am I doing wrong here.

?xml version=1.0 encoding=utf-8?
mx:TitleWindow xmlns:mx=http://www.adobe. com/2006/ mxml 
layout=vertical showCloseButton=true close=closeWindow( )

mx:Script
![CDATA[
import mx.managers. PopUpManager;

private function closeWindow( ):void {
PopUpManager. removePopUp( this);
}
]]
/mx:Script

mx:Panel width=100% height=100% title=Test
mx:Text width=100% height=100%
mx:htmlText
![CDATA[
pLorem ipsum dolor sit amet, consectetur adipiscing elit. Nam nibh pede, 
volutpat et, ullamcorper et, lacinia quis, sapien. Cras consequat tincidunt 
sapien. Nullam ac enim in velit ornare dapibus. Nunc dolor massa, facilisis sit 
amet, posuere sed, gravida et, quam. Sed ultrices aliquet sapien. Nulla aliquet 
massa at elit. Nullam viverra. Integer sodales bibendum augue. Suspendisse 
imperdiet. Donec dignissim tortor sed nisl. Proin viverra, risus nec ornare 
luctus, nibh mi posuere sem, in placerat elit lorem nec sapien. Cras 
pellentesque enim sed sem. Ut elit neque, luctus vel, facilisis in, condimentum 
a, enim./p

br/br/
br/br/
br/br/
br/br/
br/br/
Hello 
]]
/mx:htmlText
/mx:Text
/mx:Panel

/mx:TitleWindow


Thank You
Dan Vega
danv...@gmail. com
http://www.danvega. org