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.

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

Points: 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 .

Points: 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


Type your Reply or Answer

Are you human? What is 1+16+6 

Members Login

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