View Full Version : Blinking button (is it possible?)

24 Feb 2011, 3:14 AM
Hey guys...!

Is there a way to make a simple button (which is dragged-and-dropped on a toolbar) blink? I am trying to attract attention to the button. I need this feature to show people that there is "new" stuff happening on the framework...!

Thank you in advance...

24 Feb 2011, 3:20 AM
Hello Mihai,

i guess this is not a question that has do do with the designer. But i would try one of the following things:

Posibility 1: Use setInterval() to switch the className (set the AutoRef in Designer to get the Button). Advantage you can also make it stop blinking by deleting the Interval

Posibility 2: Not my Favorite ;-) Use a animatet Gif ;-)

greetings from Cologne


24 Feb 2011, 3:33 AM
Hi...! I know that it is not related to the designer, but I have tried everything to get the button to blink. I created an autoref name in the designer "myButton", and I have tried to do things like this.myButton.highlight() but it says that thisis not a method or something like that!

I am not sure how to code and where to put the code to make it highlight...!
thanks for the reply though...

24 Feb 2011, 6:41 AM
That would be this.myButton.getEl().highlight(), but it still won't work, because a button is mostly build from background images.
The only way to "blink" a cursor is by adding/removing a class and creating associated css rules to change the background-image (like @marcusboos already mentioned).

24 Feb 2011, 8:56 AM

Thanks guys... My biggest problem is the fact that I am struggeling to get any of the methods or properties accessed. I mean the following "this.myBtn.setInterval()" returns : "this.myBtn.setInterval() is not a function"...!

I am using the designer and I am simply creating a toolnbar and a button on it. I gave it a refname and I simply want to access the methods. Am I right to use it under the initComponent function??? Because it just returns errors.

What am I doing wrong?


24 Feb 2011, 9:03 AM
setInterval is a javascript method (not Ext related - window.setInterval), but I would recommend using Ext.TaskMgr.run.

1 Mar 2011, 2:29 AM
sounds too complicated coming from someone who simply wants to use the Ext Designer and simply wants one button to blink...! But thank you guys - appreciate your inputs...! :)