Flasher Archive

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


Subject: RE: [flasher] wireframe.co.za
From: AndyA
Date: Sat, 24 Feb 2001 12:31:45 -0000

Hey Brajeshwar,

Here's some help with the basics. It took me about 15 minutes to get it to
work basically, and I'm a beginner with Flash so it's not too hard.

You'll need four movie clips:

* one called Selection which holds the other three
* one for the indicator that you slide (instance name: Indicator)
* one for the grey background (instance name: Background)
* one for the yellow folders (instance name: Folders)

Create them all centered and set the registration point to the center for
all MCs (using info panel)

I put an invisible button into the Indicator which covered the area of the
indicator, then used following script for the button:

on (rollOver) {
startDrag ("", false, xLeft, y, xRight, y);
}
on (rollOut) {
stopDrag ();
}

// xLeft refers to the furthest coord to the left I want to go, xRight
refers to the furthest coord right I want to go and y is the y value of the
center of the button (so it only moves horizontally)

then in the Selection timeline, select the Indicator movieclip and use the
onClipEvent (mouseMove)

onClipEvent (mouseMove) {
XBackground = _root.Selection.Background._x
XFolders = _root.Selection.Folders._x
_root.Selection.Folders._x -= (_root.Selection.Indicator._x + XFolders);
_root.Selection.Background._x -= (2 * (_root.Selection.Indicator._x +
(XBackground / 2)));
}

// this detects the event (mouseMove) and then sets XBackground and XFolders
variables to be the present _x values of those two clips, then reduces the
_x coord of Folders by the sum of the present _x value of the indicator and
the old _x value of Folders. Same again for Background, excepet that in the
example on wireframes, the background moved faster than the folders hence
the "2*" and the "/2" (the latter to ensure smooth movement.

This gives you the basic functionality you're after. The code could be
refined some (you should really be using variables for all of the coords
etc), but you'll get the idea. If you'd like the original .fla to look at
email me at flasheratandya [dot] demon [dot] nl and I'll send it.

regards

Andy




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