Flex and Flash User Group Meeting in Ahemdabad
First Flash and Flex user group meeting was organized in Ahmadabad last Sunday in Gateway Technolabs Pvt. Ltd. Group meeting got great success. This kind of events create strong community for the current as well upcoming technology. In the meeting group members can share their experience and difficulties. I hope next time It will be more successful and more informative.
Mandar
Ahmedabad Flash Platform User Group

13-Sep-2009
Flash: Smooth animation using updateAfterEvent
Smoth animation when drag the objects
onMouseMove = function(){
updateAfterEvent();
}
greenSphere.onPress = function(){
this.startDrag();
}
greenSphere.onRelease = function(){
this.stopDrag();
}
redSphere.onPress = function(){
this.startDrag();
}
redSphere.onRelease = function(){
this.stopDrag();
}
Web design Process & Methodology

Design Process Methodology
Over many years of industry experience, we’ve developed a methodology that applies to all projects regardless of size, length, and type of service. This continuous process, namely our development lifecycle, begins with learning your goals and ends with far exceeding them resulting in the success of your new web site project.
Define
The first step is to define the exact needs and goals of your business. Your job is to teach us your vision, and ours is to bring it to life. A few examples of questions which will be addressed during this phase:
Is the site a tool for existing clients or a way of generating new business? Do you sell products and/or services directly through the web or would you prefer to generate leads that you can follow-up for further dialog? Do you require some kind of content management system? What technologies will be necessary to use for your web site?
Most importantly, how do you intend to receive your visitors? You may have the best site in the world but without visitors it is useless. The best method is through Internet search engines such as Google, Yahoo, and MSN. Therefore your site must be designed with search engine optimization and good coding style in mind right from the beginning.
The discovery phase clearly states the problem, and contains all of the information needed to design a solution to the problem.
Design
| After we’ve completed the discovery phase and received the client’s approval, we come to the design phase. Keeping in mind all your goals and priorities we will begin to design graphic and layout samples.The site’s navigation structure is one of the main focuses here as well for it must be highly optimized and quick and easy for your visitors to browse. Often an alpha site will be created without graphics to see if the site’s navigation and ability to deliver content works.
When both our design team and you, the client, are completely satisfied with the proposed “look and feel,” we then move forward with development. |
Develop
In the development phase, the web pages drawn up in the design phase will be created and optimized. Import and conversion of all database information is done at this time. Great attention to detail is given and we and utilize standard conventions for good programming style – site-wide CSS stylesheets, web-based content management systems, highly optimized graphics, etc.
Functional beta versions of the site are created and every aspect of it is tested thoroughly before site launch. Clients can watch the progress of their development and participate in testing on our development servers. The final site optimization is always done by hand using a text editor for every site we publish, no matter what application was used to create your site!
Deploy
| The final stage of the site’s creation is deployment. Once it is demonstrated that the web site functions as desired and outlined in our agreed upon proposal, it is published on your public Web server for all to see. Launches are pre-planned to ensure minimal interruption to business functions.Only now after successful deployment should your site be submitted to search engines and directories. Off-page search engine optimization can now be performed along with all other web site marketing strategies.
Two additional steps Monitor and Maintain. Monitor
|
Flex easing classes used by effects
The mx.effects.easing package contains the easing classes used by effects.
Classes
Back
Bounce
Circular
Cubic
Elastic
Exponential
Linear
Linear
Quartic
Quintic
Sine
Method
easeIn
easeInOut
easeNone
easeOut
Example
<mx:Move yFrom=”-10″ easingFunction=”Linear.easeOut” duration=”1000″ />
AS 3.0 Loader
var request:URLRequest = new URLRequest(“mandar.swf”);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
function loadProgress(event:ProgressEvent):void {
var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
percentLoaded = Math.round(percentLoaded * 100);
trace(“Loading: “+percentLoaded+”%”);
}
function loadComplete(event:Event):void {
trace(“Complete”);
}
loader.load(request);
addChild(loader);
AS3.: can stop net connection
Previous versions of the Flash player could not close connections to the internet once a download into the player has started. For example if you start loading 30mb and sudenely you need to stop and handle differnt request. previous version couldn’t do it.
In Flash Player 9, using ActionScript 3, you can now stop connections and abort loading requests made by the player. see the following code
var loader:Loader = new Loader(); var request:URLRequest = new URLRequest("image.jpg"); loader.load(request); addChild(loader); // abort loading if not done in 3 seconds var abortID:uint = setTimeout(abortLoader, 3000); // abort the abort when loaded loader.contentLoaderInfo.addEventListener(Event.COMPLETE, abortAbort); function abortLoader(){ try { loader.close(); }catch(error:Error) {} } function abortAbort(event:Event){ clearTimeout(abortID); }
Flash: Dynamically Change Frame Rate
New to ActionScript 3.0 is the ability to dynamically change the frame rate at which your file plays at runtime. The default frame rate of a Flash movie is 12 frames per second, and we can change dynamically increase or decrease frame rate run time. following example shows how to change frame rate runtime.
Create two buttons on stage and give name “faseter” and “slower”.
faster.addEventListener(MouseEvent.CLICK, onFasterClick, false, 0, true);
slower.addEventListener(MouseEvent.CLICK, onSlowerClick, false, 0, true);
function onFasterClick(evt:MouseEvent):void {
stage.frameRate += 5;
trace(stage.frameRate);
}
function onSlowerClick(evt:MouseEvent):void {
if (stage.frameRate > 5) {
stage.frameRate -= 5;
}
trace(stage.frameRate);
}
AS3.0: Run time Scale nine in Flash
Run time scale is possible in AS3.0 for Flash. see the following example.
Steps:
1. Create new Sprite
var sp:Sprite = new Sprite();
2. Fill as corner rediol rectangular shape
with(sp.graphics)
{
lineStyle(1,0×000000,1,true);
beginFill(0xff0000,.5);
drawRoundRect(0,0,100,50,15);
endFill();
}
3. set position into the stage.
sp.x = sp.y = 50;
4. Add into the stage
addChild(sp);
5. Set the scale nine grid
var slice9:Rectangle = new Rectangle(15,15,70,20)
sp.scale9Grid = slice9;
6. Change the shape of the rectangle onEnter event
addEventListener(Event.ENTER_FRAME,onLeave,false,0,true);
function onLeave(event:Event):void
{
sp.width = Math.max(mouseX – sp.x,31);
sp.height = Math.max(mouseY – sp.y,31);
}
AS3.0: Load image class
Load external image in to swf file.
package
{
import flash.display.Sprite;
import flash.display.Loader;
import flash.net.URLLoader;
import flash.net.URLRequest;
public class loadImg extends Sprite
{
public function loadImg()
{
init()
}
private function init():void
{
var loader:Loader = new Loader();
addChild(loader);
loader.load(new URLRequest(“image.jpg”));
}
}
}
Flash AS3.0, XML and E4X
ActionScript 3.0 changes things quite significantly. The good news is that the new approaches make life much easier. ActionScript 3.0 includes completely new XML functionality based on the E4X specification
In ActionScript 3.0, can target content in an XML object by using methods of the XML class to write E4X expressions.
Here I am giving an example. how to parse data through using different methods.
code:
package {
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;public class main extends Sprite {
private var xmlMessage:XML;
private var xmlLoader:URLLoader;
private var xmlRequest:URLRequest;
public function main() {
init();
}
private function init() {
addChild(menuText);
var strXMLPath:String = “myXML.xml”;xmlLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE,completeHandeler);
xmlLoader.load(new URLRequest(strXMLPath));
}
private function completeHandeler(event:Event):void {
xmlMessage = XML(event.target.data);
mText.text = xmlMessage.menuTitle;
}
}



