ActionScript.org Flash, Flex and ActionScript Resources - http://www.actionscript.org/resources
Developing Flash Components for Flex
http://www.actionscript.org/resources/articles/654/1/Developing-Flash-Components-for-Flex/Page1.html
Tolga Ozdemir
Tolga Özdemir is professionally interested in the usage areas of the internet namely for education and for marketing. Both topics convey somehow the meaning of information engineering, to him. He is a flex/flash developer who has a view on designing but he is indifference to become a designer.

You can reach his writings on actionscript, internet marketing, and e-learning via his web site http://www.tolgaozdemir.net 
By Tolga Ozdemir
Published on August 26, 2007
 
Adobe is about to release a new development kit for Adobe Flex. This tools will help Flash develpers create Flex Components by using Flash IDE. I try to make a small sample by using this tool.

Developing Flash Components for Flex

Adobe is about to release a development kit for Flex to create components by using Flash IDE. This kit may help developers add more interaction and animation effects into their flex components. Now, I will develop a small sample by using this tool.

Please notice that before reading this article you have to prepare your development environment accordingly. For more detailed information please visit AdobeLab . Then please set up this extension which helps you in creating components for Adobe Flex.

Well, let's start. Now, open a new Flash CS3 document and create a new MovieClip sample. Then run the extension command from Commands > Make Flex Component. This helps us a standardized component for Flex. Take a look at our library and make an Actionscript 3 document according to the name you gave for the MovieClip. Mine is FFButton, so I jot down FFButton.as file which is look like that:

[as]package {
import flash.events.MouseEvent;
import flash.net.navigateToURL;
import flash.net.URLRequest;
import mx.flash.UIMovieClip;

public class FFButtonUp extends UIMovieClip{
public function FFButtonUp () {
addEventListener(MouseEvent.MOUSE_OVER, over);
addEventListener(MouseEvent.MOUSE_OUT, out);
addEventListener(MouseEvent.CLICK, go);
}
public function over(event:MouseEvent):void{
trace("over");
this.scaleY =.90;
this.scaleX =.90;
}
public function out(event:MouseEvent):void{
trace("out");
this.scaleY =1;
this.scaleX =1;
}
public function go(event:MouseEvent):void{
var request:URLRequest =new URLRequest("http://www.tolgaozdemir.net")
navigateToURL(request);
}
}
}[/as]

Then run your Flash CS3 file. If everything looks correct, you are ready to make a SWC file. Please do that.

Well, we are ready to switch off Adobe Flex. Create a new Flex Application and from the properties window jump to Flex Build Path and tab to the Library Path and Add the SWC file you have just created and press OK. That's all.

My flex document looks like this:

[code]<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*">
<local:FFButtonUp x="300" y="300" />
</mx:Application>[/code]


To download source code please click here