header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
sandy
Points:70
Posts:5

11/30/2009 12:13:20 AM

Title: how to get a button from flash in flex


im using button instead of movieclip in flsh file. how to get a button in flex using swf file. give me a sample code



1
Ravi
Points: 0
Posts:0
11/30/2009 1:18:58 AM



you can use any component as button by just adding click listener. To use swf file as button load a swf file using swfloader component in flex and use its click event to do anything like button .

2
Harry
Points: 0
Posts:0
11/30/2009 1:54:58 AM



you can use css class to set skins for button and apply your swf as skin on button. Using this method you can give all the rollOver, RollOut press etc effects using swf file.
you can use css class like this

.testButton {
	upSkin: Embed(source="testTheme.swf", symbol="btn_icon");
	overSkin: Embed(source="testTheme.swf", symbol="btn_hover");
	downSkin: Embed(source="testTheme.swf", symbol="btn_down");
	selected-up-skin:Embed(source="testTheme.swf", symbol="btn_down");
	selected-over-skin:Embed(source="testTheme.swf", symbol="btn_down");
	selected-down-skin: Embed(source="testTheme.swf", symbol="btn_down");
	disabledSkin: Embed(source="testTheme.swf", symbol="btn_dis");
	selected-disabled-icon:Embed(source="testTheme.swf", symbol="btn_dis");
	selected-disabled-skin:Embed(source="testTheme.swf", symbol="btn_dis");
}
In the above class the "testimony.swf" is your swf file and symbol names are library linkages of movieclips that you created for different states of button.


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 1+13+5 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions