Tag: button | Preview mode: Common | Row form

Create cool color transition button in Flex

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

Categorize: Flex | Link | Comment:2 | Read times: 2961

Adding a custom icon to a button in Flex

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>

Tags: icon Flex button

Categorize: Flex | Link | Comment:0 | Read times: 23

Create dynamic button with actionscript

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

Categorize: Flash | Link | Comment:0 | Read times: 39