hi to all. for long time i was searched how to access particular movie clip from one swf in flex.finally i got the solution for that.
step1:
create any one component in flash as3 only
step 2:
now create movie clip name for your button.
1.Right click your button select covert to symbol from the menu.
2.now you can see one dialoge box , in that box give name of your movie clip
then click ok button.
Step 4:
After finishing the above step see your property window (Click Ctrl+F3)
give some name for your instance through that only you can access your movie clip in flex.
Once you finished the above process click the file menu export the swf file save it some other place.
How to access created movie clip in to flex application?
Step 1:
Create new project in your flex builder.copy and paste that swf file into your project.
add one swf loader in your project give thae swf as source of the swfloader.
?xml version="1.0" encoding="utf-8"?>mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
mx:SWFLoader id="swf_mc" source="btn_mc.swf" />
/mx:Application>
Step 2:
now open Script tag in your Application.Create var for movie clip
![CDATA[
import mx.utils.ObjectUtil;
import mx.core.MovieClipAsset;
import mx.controls.Alert;
private var livinginstance:MovieClip;
private var tab_mc:movieclip;
private function onLoad():void
{
}
]]>
Step 3:
now right function for the movie clip access
private function onLoad():void
{
livinginstance=swf_mc.content as MovieClip;
livinginstance.buttonMode=true;
livinginstance.addEventListener(MouseEvent.CLICK,onClick);
}
Add listener for checking access of movie clip
private function onClick(eve:MouseEvent):void
{
Alert.show("Tab1");
}
call the onLoad() function into swf complete.
finally the application code is
?xml version="1.0" encoding="utf-8"?>mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
mx:Script>
![CDATA[
import mx.utils.ObjectUtil;
import mx.core.MovieClipAsset;
import mx.controls.Alert;
private var livinginstance:MovieClip;
private var tab_mc:movieclip;
private function onLoad():void
{
livinginstance=swf_mc.content as MovieClip;
livinginstance.buttonMode=true;
livinginstance.addEventListener(MouseEvent.CLICK,onClick);
}
private function onClick(eve:MouseEvent):void
{
Alert.show("Tab1");
}
]]>
/mx:Script>
mx:SWFLoader id="swf_mc" source="btn_mc.swf" complete="onLoad()"/>/mx:Application>
just run your application and click your movieclips .its shows alert messege.
I hope this post will helpful to some one...