Create cool color transition button in Flex
Post by efox | Date: 2008-10-22
In this article I want to shows how to create color transition button by fading the background color of an element in Flex . In order to make the button more attractive, I added some effects like drop shadow, bevel and glow.
//colorAnimaton.as
package com.foxarc
{
import mx.effects.AnimateProperty;
import com.foxarc.instance.colorAnimationInstance;
import mx.effects.IEffectInstance;
Click here to read this article...
Tags: Flex color transition button
Adding a custom icon to a button in Flex
Post by efox | Date: 2008-08-30
The graphic is png with transparency and you see that it lets the background of the button show through.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Panel x="168" y="76" width="250" height="254" layout="absolute" title="Description">
<mx:TextArea left="0" top="0" bottom="0" right="0"/>
<mx:ControlBar>
<mx:Button label="Button" icon="@Embed(source='assets/demo.png')"/>
</mx:ControlBar>
</mx:Panel>
</mx:Application>
Create dynamic button with actionscript
Post by efox | Date: 2008-08-01
In this article, I want to talk about how to create dynamical button in actionscript. No design tools needed, just actionscript code. see the following example, I hope it will be helpful to you.
//draw an button
var drawArea:Array = [[0, 0], [100, 0], [100, 20], [0, 20], [0, 0]];
this.createEmptyMovieClip("btn",0);
btn.beginFill("0x000000",100);
for (i=0; i<drawArea.length; i++) {
i == 0 ? btn.moveTo(drawArea[i][0], drawArea[i][1]) : btn.lineTo(drawArea[i][0], drawArea[i][1]);
}
btn.endFill();
//set position of the button
btn._x = (Stage.width/2)-btn._width/2;
btn._y = (Stage.height/2)-btn._height/2;
// button methon
btn.onRelease = function() {
getURL("http://www.foxarc.com", "_blank");
};
Tags: actionscript dynamic button







