Flasher Archive

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


Subject: RE: FLASH: scrolling through images like a text field
From: neo binedell
Date: Wed, 29 Nov 2000 00:25:32 GMT

actionscript!

here's a simple example, MegaClip is a big clip containing all your
other clips, laid out horizontally next to each other. It is placed
under a mask that only allows you to see a small rectangle on the screen.

for simple stoopid scrolling

// forward button
on( release )
{
MegaClip._x += 4;
}

// back button
on( release )
{
MegaClip._x -= 4;
}

for more advanced scrolling you would have a velocity, etc.
this means the clip keeps being moved until it has moved a
certain amount or reaches the edges of the movie.
I usually a list of seperate clips, moving & replacing them
as neccessary to provide an unlimited range.

on( release )
{
DeltaX = 4;
DestX = MegaClip._x + SLIDE_WIDTH; // could be anything - one 'scroll'
}

// MegaClip event, MegaClip has 1 frame with all yer piccies...
// which means it will loop forever without really changing, so
// we take advantage of that and add a little worker thread
onClipEvent( load )
{
DeltaX = 0;
DestX = 0;
}

onClipEvent( frameEnter )
{
if( DeltaX != 0 )
{
var nx = MegaClip._x + DeltaX;

if( nx > MIN_X && nx < MAX_X ) // your range
MegaClip._x = nx;
else
DeltaX = 0;
}
}


rather stupid examples, but I'm sure you get my drift...

'klayder
neo binedell
-----Original Message-----
From: owneratchinwag [dot] com [owneratchinwag [dot] com]On">mailto:owneratchinwag [dot] com]On Behalf Of Laura
Hamilton
Sent: 29 November 2000 12:48
To: flasheratchinwag [dot] com
Subject: FLASH: scrolling through images like a text field


Bill Bradbury wrote:
I've created a movie clip that contains several
buttons that I want the user to be able to scroll through
on mouseover.
Basically, I have a scroll left button, a scrollright button
and a movie clip.
I can't figure out how to make this happen. I've spent
sometime searching for a tutorial and most of them
show you how to scroll a text field only. Any help would be appreciated.
--------------------------------------------
I would love to know how to do this too.

I got to the point where I could scroll forward nicely, with each image on a
separate layer and motion tweens lasting 10 frames to slide each image in
from the right and stop in the middle of the viewing frame. The next click
of the scroll-right button would then slide that image out of the viewing
frame to the left and slide in the following image from the right, and so
on.

The scroll-right button just uses a "Go to Next frame" action, then in that
next frame (the first of the motion tween series) there is a Play action
that plays the motion tween through to the next frame in which the new image
is displayed in the center of the viewing frame. At that point there is a
Stop action.

That part worked beautifully. The part that I couldn't solve was the
scroll-left button. I can't make the movie play backwards, so I never got it
going. My thought was to perhaps create a different set of frames that would
basically be the reverse motion for each corresponding forward move through
the slideshow, but then I got a bit confused as to how I would manage two
sets of mirror image frames with two buttons that specified only "Next
frame" and "Previous frame".

I ended up bagging the idea of sliding the images in and out for now, since
I need to finish this damned site up and move on, but I would love to know
how to solve the problem of the scroll-left button and how I can make it
work with motion tweens.

My other idea was to take all 35 images, put them in a long horizontal line
and make them one object. Then I could use the same basic mechanism that I
use to scroll through a text field. Unfortunately that didn't work either,
because I could never make the work area wide enough to be able to put all
my images in a line.

Ugh. Can anyone help us out here?

Laura Hamilton


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
November 27-29, 2000, LONDON, National Film Theatre

Produced by United Digital Artists and lynda.com
-Sponsored by Macromedia, Adobe Systems and Apple Computer
-http://www.flashforward2000.com or UK tel. +44 (0870) 751 1526
Register before November 10 and save 200
http:// www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
November 27-29, 2000, LONDON, National Film Theatre

Produced by United Digital Artists and lynda.com
-Sponsored by Macromedia, Adobe Systems and Apple Computer
-http://www.flashforward2000.com or UK tel. +44 (0870) 751 1526
Register before November 10 and save 200
http:// www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  FLASH: scrolling through images like a t, Laura Hamilton

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