MANDAR

AS 3.0 : set Interval

Posted in Flash Designer by Mandar on May 12, 2009

Set interval in AS3.0

var timer:Timer = new Timer(100);
timer.addEventListener(TimerEvent.TIMER, onTimer,false,true,false);
timer.start();
function onTimer(evt:TimerEvent):void{
hand.rotation +=5;

}


Load SWF into MovieClip in AS3

Posted in Flash Designer by Mandar on May 12, 2009

Loading external swf file is essay in AS2.0 but it is not so essay in AS3.0, to load swf file need to define loader class and URL path pointing to the external swf.

var swfLoader:Loader = new Loader();

holderMC.addChild(swfLoader);

var bgURL:URLRequest = new URLRequest(“loadSWF_File.swf”);

swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadProdComplete);

swfLoader.load(bgURL);

function loadProdComplete(e:Event):void {

trace(“file loaded”);

}


Action script 3.0 : Depth Mantain

Posted in Flash Designer by Mandar on May 12, 2009

Previous version in As2.0 depth maintain by swapDepth() method, but in AS3.0 the method getNextHighestDepth is no longer supported. Here’s how to swap depth in Actionscript 3. 0 Use the setChildIndex() method to changes the position of an existing child in the display object container with the instances name.

Where In AS3.0 set the depth automatically through indexing like addChild(car) maintain on 0 depth while car.addChild(mirror) mirror pushed over car. Maintain depth by addChildAt() method. for example addChildAt(mirror, car).


AS3 : Removing Object from Memory

Posted in Flash Designer by Mandar on May 12, 2009

Inadequate assets managements can result memory leaks. When you are sure you will not longer requirement remove them from memory.

Keeping track the object and remove unnecessary and unwanted objects. some time we remove an object from display list but forgot to remove from RAM. see the following example for  better understanding.

var car:MovieClip = new Car();
car.x = car.y = 100;
addChild(car);

stage.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);

function onClick(evt:MouseEvent):void {
this.removeChild(car);                                 //ball removed from display list but still exists
trace(car)
car= null; //ball now entirely removed
trace(car)
stage.removeEventListener(MouseEvent.CLICK, onClick);
}


Display List Classes – AS3.0

Posted in ActionScript 3.0 overview by Mandar on May 12, 2009

Following chart shows display classes that contributes to the display lists.

displayClassIit is possible for shapes, bitmaps, videos, and static text, among other items, to exist inside movie clips. Yet in the diagram in, MovieClip appears to be lowest in the display list hierarchy. Display Objects can be control by the AS directelly.


AS 3.0 Garbage Collection

Posted in ActionScript 3.0 overview by Mandar on May 11, 2009

With great power comes great responsibility. Adobe claimed AS3.0 is 10 time faster than AS2.0. but we must be use it in proper way. Garbage collection play important roll in AS3. AS3 developer need to develop strong understanding how to operate Garbage collection.

Garbage collection is the method by which Flash Player purges from memory objects that you no longer need. we need to adopt some general code practice for it.

Following are some essay common practice which we are never take care. There are three optional parameter end of the addEventListener(); method.

eventTarget.addEventListener(EventType.EVENT_NAME, eventResponse, useCapture:Boolean, priority: int, weakReference:Boolean);

There are three optional parameter which we generally skip it.The first two optional parameters control when the listener function executes. You probably won’t need to adjust these values. The first optional parameter, useCapture, allows you to handle the listener event before it reaches its target (if set to true) or once the event has reached its target (if set to false) or is bubbling back up through the display list. The default (false) is to react to all events captured at or after the event reaches the target, and this is the configuration you will likely use most of the time.

The second optional parameter, priority, allows you to order the execution of multiple listeners set to respond to the same event in the same phase. This, too, is unlikely to be an issue, and the default parameter of 0 will serve you well in the vast majority of circumstances.

The third optional parameter, weakReference, is the option we want you to understand and start using. In a nutshell, this helps with memory management, in the event that you’re not careful about removing unneeded listeners.

All you need to do is change the weakReference setting of the addEventListener() method from its default value of false, to true. Because it’s the third optional parameter, values for the first and second parameters must be included so Flash knows which parameter
you are trying to set. You will rarely need to change those values, so you can use their aforementioned defaults (false for useCapture and 0 for priority).

use the addEventListener() method with this syntax:
eventTarget.addEventListener(EventType.EVENT_NAME, eventResponse, false, 0, true);


CS4 Less Efforts More Fun

Posted in Flash Designer by Mandar on February 2, 2009

“CS4 less efforts more fun” Adobe Creative Suite 4 launched by Adobe in Ahmedabad and I had attained impressive seminar Main aim behind CS4 not only to upgrade there older version but also collect two community ‘designer’ and ‘developer’ to gather.

Adobe also realize global resection, trying to explain on behalf of customer who need more faster works in less time, because customers do not want to spend more money and time behind any development. Adobe warned that next comings days are very difficult those graphics designers who are not want to upgrade them self and CS4 is best tools to upgrade very easily.

Some of the excellent features were covered in the seminar .

Photoshop CS4
Import 3-D file and edit it through every angles in few command as well as in short time. Interface familiar with 3D software’s

Content Aware Scale:
This tool is like magic! It allows you to scale in Photoshop CS4 while preserving the important parts of the photo. For more information see the demo.

Indesign CS4
New features added in Indesign like Images proportional. Indesign files can export for flash with conversation 300ppi to 72ppi, very help full for online demonstration

Illustrator CS4
Lots of features in added in illustrator just like designers can able to set color alpha which was very difficult in previous version, multiple art board max limit is 99 etc…

Fireworks CS4
First question had been asked by Vaishak during the seminar “how many people working in Fireworks” and it was amezzing…………………. only just two people! Me and other one who were raised there hands.

Fireworks CS4 is more stronger than previous one especially for wire frame and prototype creating. Vaishak shown excellent features which were not possible and some of were very difficult to do in Photoshop.

One of the most excellent features is to make layout in to Fireworks and export in to the HTML. HTML page will ready with well coded CSS and Images. When Vaishak shown this feature every body raised their hands and asked about CSS as well as HTML code structure and it was amazing!!!! CSS and HTML was perfect without any extra code.

Flash CS4
Flash introduced with Flash player 10 Dazzling Effects, Better Performance, Runs on Linux. Flash Player is installed on roughly 95% of the world’s internet-connected PCs. It also runs on a number of phones and mobile devices.
One of the best and most helpful features for animator is Bone tool so now not multiple layer and frame by frame animation. Flash CS4 interface also slightly change and more flexible. More advance feature introduce for motion tween and Audio editing.

But at the end of the seminar I was little bit disappointed because absence of Flex, Air and Flash Catalyst. Vaishak was promised me to invite next event for Flex and Flash Catalyst.


picture-068

cs4_launch

DEGRAFA

Posted in Flash Designer by Mandar on January 1, 2009

Is “Flash catlist” work like ‘DEGRAFA’?
It’s made to solve the headaches of Flex developers when it comes to graphics. Vectors, bitmaps, fills, strokes, scaling, skewing, rotation, translations, filters, repeaters are just a few of the features Degrafa opens up to Flex coders.

Less Action script and more MXML for those action script programmers have been able to create low level graphics, and also useful non-actionscript programmer.

http://degrafa.org


Flash with CSS attachment

Posted in Flash Designer by Mandar on December 31, 2008

Using CSS
One of the first reasons I wanted to use because of cut of long, tedious and time consuming process.

First make CSS called “style.css”
Code Example

p {
font-family: Arial,Helvetica,sans-serif;
font-size: 12px;
}
.headline {
font-size: 14px;
font-weight: bold;
}

.bURL {
color: #000099;
text-decoration: underline;
}

.author {
text-align: right;
font-style: italic;
}

.errorMessage {
color: #CC0000;
font-weight: bold;
}

First function is to get the CSS stylesheet, parse it, and apply it to our text box. Select the first frame in your “Actions” layer and put the below in. This is straight out of the Flash help documents:

Action Script

function getNewsStyles() {
news_txt.text = “Getting news…”;
// load stylesheet first, then get content (separate function)
var flash_css = new TextField.StyleSheet();
flash_css.onLoad = function(success:Boolean) {
if (success) {
news_txt.styleSheet = flash_css;
getNewsContent();
} else {
news_txt.htmlText = “Could not load CSS stylesheet.”;
}
};
flash_css.load(“news_styles.css”);
};

Congratulations to Bharat Patel

Posted in Flash Designer by Mandar on December 31, 2008

Congratulations to Bharat Patel who become Adobe Certified Flex Developer.