PDA

View Full Version : How to achieve this line "open/close" effect?


FFighter
01-13-2007, 10:12 AM
Hello!

I'd like to achieve a masking effect similar to the one present on this template:


http://www.templatehelp.com/preset/pr_preview.php?i=10712&pr_code=3Q2P7g93F4eju93em4J52LUq1hYM59

The two horizontal lines that move vertically to show up the initial background, then they "get together" and start moving in reverse to show the picture gallery.

But I'm confused on how to do it... firstly, do you think that it is scripted or it is a timeline-only animation?

If it is to be scripted, I think that a mask MovieClip would have to stretch its height to the current line _x position...

What do you think?

Thanks,

Marcelo.

Patr!ck
01-13-2007, 03:41 PM
Hi,

OPTION 1

I suppose you would need a movie clip with gallery, contact, etc.
Then you need a mask clip (going from "opened" to "closed" to "opened" position) one layer higher.
Then in onRelease something like this:

targetPage = "gallery";
maskClip.gotoAndPlay("close");

Then when maskClip reaches "closed" frame, it runs the action:

pages.gotoAndStop(targetPage);

maskClip continues to open now and you can see new page.

OPTION 2 more action script (but will work much better, for example in case of someone clicking another button while animation runs)

As before you need a mask clip (but going from "opened" to "closed" position only) one layer higher.

Then in onRelease you change onEnterFrame for the mask movieClip using _currentFrame+1 to close and _currentFrame-1 to open.

This is like i would do it, but if someone comes with better idea i would be interested too.

Hope it helps to give you some start.

Patryk

FFighter
01-13-2007, 07:59 PM
Thank you Patrick. I'm a coder, so I thought on something more script-oriented, something like creating the mask at runtime and scale it as needed through code (and position the correspondent "line"), however, I think the way you stated would be far easier, thanks for the tip :D