Sunday, December 21, 2008

Common library for your Flash application

Hi,
In this i like to tell a simple way how to use the same movie clip in all your files with out any searching.

By using Common library.....

First create a file consider your logo so that in what ever file you like to put the corresponding logo can be placed with easy way.
Create a Flash file with a library containing the logos and all your movie clip you want to use.
Place the Flash file in the location
C:\Documents and Settings\\Local Settings\Application Data\Adobe\Flash CS3\en\Configuration\Libraries\
And now check your flash windows -> common libraries You can see the file name you placed :-)

Now whatever movie clip you want to import which is in the common library just go to windows -> common libraries -> You will get the movie clip in a separate library you can drag it to the working area to include in the new file....

Enjoy the cool stuff...

Friday, December 19, 2008

Group your flash files

Hi,
In this i like to tell a tips how to handle more flash files to group into a single one file and open the related files whenever you want.




This can be done with a file called flash project file it has the extension .flp

You can do this by going to file->new and the window will appear in that select the Flash project and then add all your fla project and .as files to it by clicking the Add files in the bottom of the project window. you can get the project window from windows->project or Shift+F8









By doing so you no more need to get confuse what are the files involved in the current project.
Planing for a BIG project start with project file in flash












if t is useful plz leave a comment

Saturday, December 13, 2008

Make flash full screen in browser

Hi,
In this blog i like to explain How to make the flash in full screen of the browser...
You might notice some of the flash site where you can find all the area of the browser will be a flash That can be done using the publishing setting as follows in flash.
go to file-> publish setting a dialog box will appear in that find weather the HTML tab is available in the below image you can see the image where i sport it out...
Set the corresponding settings





Set as percent in Dimension
By default it will be 100 and 100.if it is not change to 100 and 100.



Set the scale as No scale.
so that your file will not get scale alignment as center and center. So that the flash file will be align in center




Once you set this options just publish the file
You can find a .html file in the folder.
open it in dream viewer Modify->page properties









set all margin as 0 (Zero)





Now your flash will be setting to the full screen in browser.

Check it out and enjoy

Tuesday, December 9, 2008

Update a image 3 Option

Hi,
I like to explain how to Update a image in the flash.

Option 1:
In this option you need to know from where you placed the image initially. You need to update that image with New one.
Open the Library (ctrl + l), Right click the image and give update it will update the image so that it will affect the image int the work area.

Option 2:
In this option you no need to know wher was the old images was.
You can open the library and selsct the image and right click and give properties.
a dialog box will get open in that give the click import and select the image you want to update.
it will get updated...

Option 3:
In this option if you thought of updating only one image(in the work area) and the rest must be same you can go for this option.
import the images into the library by file->import-> import to library...
and click the image in the work area open properties (ctrl +F3) and give swap.
The dialog box will open in that select the New images.

Saturday, December 6, 2008

Rectangle primitive Tool

Hi,
I like to explain a small tool where most people don't use to use it......
It is called as "Rectangle primitive Tool" by default it use to the the sub tool in the Rectangle tool in Tool panel.

If we thought of drawing a curved edge rectangle this Rectangle primitive Tool is useful.
Even after drawing a curve we can adjust the curves.
It is too efficient in the way like making changes in all 4 corners separately . Where you can get the exact way of you want. The most highlight is you can edit whenever you want.....




I hope you got some New thing regarding flash

Cool fine

User option button

Hi,
In this i like to explain how to create User option button.

create a movie clip with two frames and make the first frame as off and second as on.
Place the art work like on a option button in first frame as off and second one as on and place a stop(); command in the first frame action script window so it will resemble as the below one...



copy and past the same movie clip option in the main time line and name it as op1 and op2.
which look like the image specified below.


//code is as followes
op1.gotoAndStop("on"); //set The option 1 as default on
op2.gotoAndStop("off"); //set The option 2 as default off
_root.selected_option=1; //storing the selected value for future reference

//function for option 1 button when clicked
op1.onRelease = function()
{
if(_root.selected_option<>1) //check weather the option 1 is not selected
{//if not selected
op1.gotoAndStop("on"); //make the option1 movie clip as on
op2.gotoAndStop("off"); //make the option2 movie clip as off
_root.selected_option=1; //set the value as 1
}
}

//function for option 2 button when clicked
op2.onRelease = function()
{
if(_root.selected_option<>2) //check weather the option 2 is not selected
{//if not selected
op1.gotoAndStop("off");//make the option1 movie clip as off
op2.gotoAndStop("on");//make the option2 movie clip as on
_root.selected_option=2; //set the value as 2
}
}

Friday, December 5, 2008

panning using Flash AS 2.0 code

Hi
I like to put a small game code for moving a object with ease

create a movie clip with some thing like face or ball or what ever inside it.
place the movie clip inside the work Area name it as obj. copy and paste the code below in the first frame and execute now where ever you click the mouse your object follow it....
Done...

//your code hear
var mouseListener:Object = new Object();
mouseListener.onMouseDown = function() {
_global.xpoint = _xmouse;
_global.ypoint = _ymouse;
};
Mouse.addListener(mouseListener);

obj.onEnterFrame = function() {

var dy:Number;
var dx:Number;
dx = 0;
dy = 0;
dx = ((_global.xpoint)-this._x)/5;
dy = ((_global.ypoint)-this._y)/5;
if (Math.abs(dx)<0.4) {
dx = 0;
} else {
this._x += dx;
}
if (Math.abs(dy)<0.4) {
dy = 0;
} else {
this._y += dy;
}
};
//End of your code

cool fine

Thursday, December 4, 2008

Strange Problem(fixed)

I was using Flash CS3,
In that some time when i open all ready created flash file the vector animated object in that use to get flicker then if i go through the full time line it use to start work properly it was happening in some of my files.
Fixed
In that case one day i try opening the font mapping in Edit and substitute the fonts it stats working properly now. When it happens once again just went to Edit -> font mapping substitute the font ....
Strange but solved a big problem for me... Hope some one also face the same problem Just for you guys....

if some one faced this problem Plz comment on this...

Class and Function in AS3

Hi Guys,
This is my first tutorial in AS3.
The big change in AS2 and AS3 is Object Oriented Programming.

In AS3 all are considered as Object, Class. In this let me say What is Class ? , What is Object? , What is Package and their syntax.

Package:
Package is the collection of class. Class needs to be specified with in a package.

Syntax:
package
{
....
...
}

Class:
Class is the collection of function and variables.

Syntax:
class
{
...
...
}

type can be of 4 types : dynamic, final, internal, public where internal id default.

Object:
Object is the instance of class. Hear is the power of Object oriented programming by creating a single class we can create multiple objects.

var : = new ();

Example with all package, class, object...

//sample.as
package
{
class sample
{
sample()
{
trace("Hi");
}
}
}

//main.fla
var my_obj:sample = new sample();

Note : Both main.fla and sample.as must be in the same place.
Note : AS3 is case sensitive.