Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Re: FLASH: how do you make a draggable mask?
From: Markus Joos
Date: Sat, 5 Aug 2000 07:17:50 +0100

Hi to all intereted in the magnifier, I
just added a zoom function to the magnifier !
http://rcswww.urz.tu-dresden.de/~joos/lens
for all who are interested in the fla I added a dowload button, but for
whatever reason it opens the fla, in my browser (Netscape 4.7) instead of
showing the dowload dialog-box (Any hints on what I am doing wrong here are
greatly appreciated!) - So, anyone who is interested and can`t dowonload it,
e-mail me off list.
Here the description how it is done:
1) Since you can`t drag a mask, what you basically have to do is move the
content under the mask
2) make a mc called symbol1 (I know, this is a bad name). within this mc you
can put whatever content you like to be magnified - images, text ...
probably
even a animated mc ( I haven't tested this)
3) on the main timeline in frame one make an instance of symbol1, instance
name: piconstage
4) make a new symbol called symbol2 (this is the magnifier), within symbol2
make a mask layer, draw a circle as the mask. In the masked layer drag an
instance of symbol1, instance name: bild (doesn't matter where you drag it,
since it will be moved during runtime anyway)
5) in frame 1 add the following actions:

Start Drag ("/drag", L=110.6, T=81.5, R=404.6, B=266.5, lockcenter)
Set Variable: "x" = getproperty("/drag",_x)
Set Variable: "y" = getproperty("/drag",_y)
Set Variable: "picx" =
getproperty("/piconstage",_x)-(getproperty("/piconstage",_width)/2)

Set Variable: "picy" =
getproperty("piconstage",_y)-(getproperty("piconstage",_height)/2)
Set Variable:
"scale"=getproperty("/drag/bild",_width)/getproperty("/piconstage",_width)
Set Variable: "newx" = -scale*(x-picx)+getproperty("/drag/bild",_width)/2
Set Variable: "newy" = -scale*(y-picy)+getproperty("/drag/bild",_height)/2
Set Property ("/drag/bild", X Position) = newx
Set Property ("/drag/bild", Y Position) = newy

6) In the second frame: goto and play (1)

7) In the zoom in buttons action tab:
On (Roll Over)
Set Property ("/drag/bild", X Scale) = GetProperty (
"/drag/bild",_xscale)+50
Set Property ("/drag/bild", Y Scale) = GetProperty (
"/drag/bild",_yscale)+50
End On

8) In the zoom in buttons action tab:
On (Roll Over)
Set Property ("/drag/bild", X Scale) = GetProperty (
"/drag/bild",_xscale)-50
Set Property ("/drag/bild", Y Scale) = GetProperty (
"/drag/bild",_yscale)-50
End On

That's basically it - sorry if the actionsscript is a little confusing. If
just want to use the fla as it is, simply replace the content in symbol1
with
whatever content.

Hope that all this is understandable, otherwise don't hesitate to ask on or
off list.

Markus Joos
* Institute for Apllied Cognition Research, Dresden University of Technology
* joosyatpsy1 [dot] psych [dot] tu-dresden [dot] de


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Full flasher archive now available online at:
http://www.chinwag.com/flasher/archive.shtml
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  Re: FLASH: how do you make a draggable m, Darren Critchley

Replies
  Re: FLASH: how do you make a draggable m, mbain

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]