Wednesday, July 30, 2008

Jokes i liked

Hi,
some jokes i liked

Teacher :What happened in 1869?
Student:Gandhi ji was born.
Teacher :What happened in 1873?
Student:Gandhiji was four years old.


Question:What is the fullform of maths.
Anwser:Mentaly affected teachers harrasing students


Teacher :Because of Gandhiji's hard work what do we get on 15th August.
Student:A holiday


Teacher :Tomorrow there will be a lecture on Sun.Everyone must attend it.
Raju:No ma'm! I will not be able to attend it.
Teacher :Why?
Raju:My mother will not allow me to go so far!!!


Teacher:"Can anyone give me an example of Coincidence?"
Johnny:"Sir, my mother and father got married on the same day same time."


Teacher: How old is ur father.
Sunny:As old as I am.
Teacher:How is it possible?
Sunny:He became father only after I was born. (1st Rank)


Teacher:There is a frog,Ship is sinking,potatoes cost Rs 3/kg .Then,what is my age?
STUDENT:32 yrs.
Teacher:How do you know?
STUDENT:Well,my sister is 16 yrs old and she is half mad.


Teacher: Where does God live?
Little boy: I think he lives in our bathroom.
Teacher: Why do you say that?
Little boy: Well, every morning my daddy bangs on the door and says, 'God, are you still in there?'


Teacher:"What is your name?".
Student:"Mera naam Suraj Prakash hai."
Teacher:"When I ask aquestion in english,answer it in english."
Student:"My name is Sunlight."

hahaha... Just for laugh enjoy

Problem and solution of simple pre loader

Hi,
This can be specified as the continuation of the older post where i like to say where we cant use the simple pre loader

Problem
* when you load a swf inside another movie and the inside movie has this script then this will not work. Since this will check for the root movie clip where that is all ready loaded in the client system.

Solution
* insterd of using the _root replace it with the key word this where this will be referring the present/current swf so that the problem will be solved.

This solves a major problem since we no need to care of which swf is getting loaded to which one.
But still some more question rises yes let me tell what is the next step of pre loader in the Advanced pre loader.

simple Preloader

Hi,
In this I like to tell how to create a pre loader

place a dynamic text field with the name pre. Make sure this text box extends in the first 3 frames

Frame 1 code:
per.text = "0%";

Frame 2 code:
pre.text = (Math.floor(_root.getBytesLoaded()/_root.getBytesTotal()*100)+"%");
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
pre.text = "100%";
gotoAndPlay("main_movie");
}

Frame 3 code:
gotoAndPlay(2);

Frame 4:
Place a label as main_movie

This is the most common and simple type of pre loader

as i all ready specified place a dynamic text field which is over there in all the first 3 frame
this will start play in that case the first frame will set the text field as 0%.
Then it will come to 2nd frame and check weather the total size of file in bytes is equal to total number of bytes loaded, if it is equal it will go and play the 4th frame where it is named as main_movie or else it will go to the 2nd frame where it will check once again for the total bytes loaded with the Total file size.
hope this will help...
Let me tell some advanced type of pre loader soon.

Friday, July 4, 2008

Nice trick to load a flash site or html site

Hi,
This is a simple but tricky way of loading flash website or html site.
basically most people use to create two website with flash version and html version of same site.
In that case some use to go for a complected way to solve this way this is some simple way to solve this.

Situation: is if the browser has a flash player installed then it needs to link to flash site and if there is no flash player then it will link to the HTML site.

Solution:
Step 1 : make ready the main flash site and the html site. let consider the htmlsite main page as html_main.html and flashsite as flash_main.html.
Step2 : create a separate flash file with the low dimension 1 X 1.
Step3 : In this first frame place a code to load the flash site as getURL("flash_main.html");
step4 : in the file which has the 1X1 dimention file put the code as

<META HTTP-EQUIV="Refresh" CONTENT=5; URL=html_main.html">

in the first line of your main index file.
your got the result. Simple right check below how it work...

How it work.

If the flash player is installed then the flash will get load and it will load the flash site this is the first case.
If the flash player is not there it will not load any flash file (the 1X1 dimention file) and no redirecting to the flash site will happen.
In that place the code in the html page will refresh and redirect the html page to the new html site this is second case...

Most people might knowing this logic but any how i found this logic intresting so i shared with you...

i has also put the same procedure to my site www.gbala.com...
Cool enjoy...

How to get the frame number

HI,
This is not much useful but will be needed for some reason.
There is a function called _currentframe which is used to get the current time line frame.
This is also used inside the movie clip like movieclip_name._currentframe which will return the particular movie clip's current frame number.

eg
trace(mc_1._currentframe );

displayes the mc_1 movie clip current frame number

Wednesday, July 2, 2008

transparent page in flash

Hi
I like to say how to create transparent background in flash for a web page.
Create a flash with a transparent effect...

and save the file and select file -> publish setting (second image)
select the html tag and select window mode as "transparent window" the file you will get a html file with transparent option file.

How to check this:
* You can change your back ground color and get the transparent file affect the flash file.
Like the output shown below where i specified below is with blue back color


the check will be similar to this below image

Enjoy getting this.