Skip to main content

Posts

Showing posts from March, 2012

AS3: Custom Button Controller

Here is the pseudo code for the flash application architecture of custom-button movieclip. <movieclip name="controller_mc"> <frameset> <frame name="normal"> <textfield name="caption" framespan="4"></textfield> <graphics color="#333333"></graphics> </frame> <frame name="over"> <graphics color="#666666"></graphics> </frame> <frame name="down"> <graphics color="#999999"></graphics> </frame> <frame name="disabled"> <graphics color="#333333" alpha="0.7"></graphics> </frame> </frameset> </movieclip> The controller class of the custom button. package com.engine { import flash.display.MovieClip; import flash.events.MouseEvent; /** * @file CButton.as * @author Abhishek Kumar */ public class

AS3: Custom Dropdown

Here is the code for the custom dropdown component. /** * @file Sample.fla * @author Abhishek Kumar */ import com.engine.CDropdown; import flash.display.MovieClip; var cb:CDropdown = new CDropdown(dropdown_mc, onclick); cb.attachListeners(); function onclick(mc:MovieClip):void { trace(mc.name); } The pseudo code of application (Sample.fla) design architecture. { movieclip: 'dropdown_mc' { movieclip: 'controller' { textfield: 'caption', frames: [up, over, down] } movieclip: 'dropdown' { movieclip: 'item0' { textfield: 'caption', movieclip: 'selected', frames: [up, over, down] } movieclip: 'item1' { textfield: 'caption', movieclip: 'selected', frames: [up, over, down] } movieclip: 'item2' { textfield: 'caption', movieclip: 'selected', frames: [up, over, down] } movieclip: 'item3&