RSS link icon

.

Great magnifying glass effect


In this great flash tutorial I will show you how to apply a great and fun magnifying effect to an image of anastacia, theres no real reason I choose Anastacia, it was just the first image I came up with.

 

 

First off we will do all the preperations. So start by importing you image of Anastacia, and copy the image to a new layer just above it, the top image of anastacia you will have to resize as shown below.

 

flash magnify effect

 

Now place the two images center of stage, on top of each other, and rememer to make the stage a bit larger than the smallest image, you will see the logic in that later.

 

flash magnify effect

flash magnify effect

 

Now we need to make our magnifying glass, I'm not going into how you draw your magnifying glass, but just draw a black oval with the oval tool, right click and convert it to a movieclip give it an instance name, I named mine "glass".

 

Its important to have your black oval "magnifying glass" movie clip in a separate layer above the two anastacia image layers.

 

Now we are set to go to the actionscript panel and write some code, (note its in AS2 and not 3, sorry but i'm at school and only AS2 works here).

 

Now write in the following code from the image below.

 

flash magnify effect

 

What the code does is to make to variables X and Y giving them a values of the mouse position - 10, then make our glass position = its position adding values so it slowly moves closer to the mouse position. (Just an interesting little effect, you might as well make the glass position equal to the mouse postion).

One last thing before we forget it, go to the layers panel and right click the layer containing our glass, and choose mask. Test your movie and you should see the effect, if not you can download the flash project file here and look at what you might have done wrong.

 


vanny says: 2008-06-26

i fixed my problem

nessa says: 2008-06-26

min e came up with this error Error Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Statement must appear within on/onClipEvent handler _root.onEnterFrame = function () { Total ActionScript Errors: 1 Reported Errors: 1

Ricky C says: 2008-05-15

Nvm i fixed it allready

Ricky C says: 2008-05-15

mmmm i tried it and put the code on the first frame and if I open the flash movie my mouse doesnt move when i roll over the screen..

musafer says: 2008-05-15

its not intresting

saheer says: 2008-05-15

My bad, I forgot to mask the last layer... it runs great dude, congrats for your tutorial...

rishabh says: 2008-05-01

same here...the same problem as vanny

HELP! says: 2008-04-18

If I mask it, all it does is have a white background and if I donChr(34)t, it doesnChr(34)t magnify, (I didnChr(34)t use that pic)

Alex says: 2008-04-23

My bad, I forgot to mask the last layer... it runs great dude, congrats for your tutorial...

Alex says: 2008-04-23

Vanny you must write the code on the first frame, not on the figure, but I still got a problem, I see only a black circle and not a magnifiyn glass, so, whats wrong something missing dude!!

Admin Bob says: 2008-04-11

Vanny, it looks like you forgot something in the code, try to download my file project and take a look at it.

Vanny says: 2008-04-09

There is an error on the action script after i typed the codes. Error Scene=Scene 1, layer=glass, frame=1:Line 1: Statement must appear within on/onClipEvent handler _root.onEnterFrame = function () { Total ActionScript Errors: 1 Reported Errors: 1