Hi,
From my previous post here i just explained how to add tool tip for movie clip in flex.
Here i added sample code for tool tip to movie clip in flex.
?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;
import com.hybrid.ui.ToolTip_mc;
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);
livinginstance.addEventListener(MouseEvent.MOUSE_OVER,showToolTip);
}
private function showToolTip(event:MouseEvent):void
{
switch(event.currentTarget)
{
case livinginstance:
tool_Tip(event.target,"BUTTON");
break;
}
}
private function tool_Tip(obj:Object,tip:String):void
{
var tf:TextFormat = new TextFormat();
tf.bold = true;
tf.size =15;
tf.italic=true;
tf.font="_typewriter";
var tool:ToolTip_mc=new ToolTip_mc();
tool.hook = true;
tool.cornerRadius = 15;
tool.tipWidth = 80;
tool.align = "right";
tool.titleFormat=tf;
tool.border = 0x000000;
tool.autoSize=true;
tool.borderSize = 2;
tool.show(obj, tip);
}
private function onClick(eve:MouseEvent):void
{
Alert.show("Tab1");
}
]]>/mx:Script>
mx:SWFLoader id="swf_mc" source="btn_mc.swf" complete="onLoad()"/>
/mx:Application>
This is a place for learning new things. "The greatest pleasure in life is doing what people say you cannot do"
Monday, June 14, 2010
access of movieclip in flex
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...
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...
Flex testing tools
Hi to all.here we discuss about testing tools for flex 3.
In this post i m explained how many tools we had in flex for testing our application.
basically we had many tools, but I'm shorted it.
1.Flex Unit
2.Flex Monkey
3.RIA test
Flex Monkey:
FlexMonkey is an Adobe AIR application used for testing Flex and AIR based applications. Providing the functionality to record, playback and verify Flex UI interactions, FlexMonkey also generates Action Script-based testing scripts that you can easily include within a continuous integration environment.
You can use this tool to see how user uses your application. It can log all the events like, clicks, scrollbars etc, which you can analyze later to see how user used it
For more details please refer the following links
http://www.adobe.com/devnet/flex/articles/flexmonkey.html
http://http//www.gorillalogic.com/fonemonkey/features%20
RIA Test:
RIATest is a GUI test automation tool for Adobe Flex applications. RIATest does for your GUI what FlexUnit does for your code.
refer:
http://www.riatest.com/
FlexUnit:
FlexUnit is a unit testing framework for Flex and ActionScript 3.0 applications and libraries. It mimics the functionality of JUnit, a Java unit testing framework, and comes with a graphical test runner.
Here are the links to both the releases of FlexUnit
http://opensource.adobe.com/wiki/display/flexunit/FlexUnit;jsessionid=FBE213CAA0E580729AFA0BAFB9EAE6BE
To learn how to use the FlexUnit see these tutorials and articles :
http://blog.blackpepper.co.uk/black-pepper-blog/Flex-unit-testing-and-continuous-integration.html
http://www.insideria.com/2008/04/unit-testing-with-flexunit-1.html
I hope the above information will helpful to someone who is new to flex testing tool.
In this post i m explained how many tools we had in flex for testing our application.
basically we had many tools, but I'm shorted it.
1.Flex Unit
2.Flex Monkey
3.RIA test
Flex Monkey:
FlexMonkey is an Adobe AIR application used for testing Flex and AIR based applications. Providing the functionality to record, playback and verify Flex UI interactions, FlexMonkey also generates Action Script-based testing scripts that you can easily include within a continuous integration environment.
You can use this tool to see how user uses your application. It can log all the events like, clicks, scrollbars etc, which you can analyze later to see how user used it
For more details please refer the following links
http://www.adobe.com/devnet/flex/articles/flexmonkey.html
http://http//www.gorillalogic.com/fonemonkey/features%20
RIA Test:
RIATest is a GUI test automation tool for Adobe Flex applications. RIATest does for your GUI what FlexUnit does for your code.
refer:
http://www.riatest.com/
FlexUnit:
FlexUnit is a unit testing framework for Flex and ActionScript 3.0 applications and libraries. It mimics the functionality of JUnit, a Java unit testing framework, and comes with a graphical test runner.
Here are the links to both the releases of FlexUnit
http://opensource.adobe.com/wiki/display/flexunit/FlexUnit;jsessionid=FBE213CAA0E580729AFA0BAFB9EAE6BE
To learn how to use the FlexUnit see these tutorials and articles :
http://blog.blackpepper.co.uk/black-pepper-blog/Flex-unit-testing-and-continuous-integration.html
http://www.insideria.com/2008/04/unit-testing-with-flexunit-1.html
I hope the above information will helpful to someone who is new to flex testing tool.
Subscribe to:
Posts (Atom)