Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | FLASH: Tell Target and Actionscript Question: Movie clips to fade in, then out |
From: | unique |
Date: | Sat, 27 Nov 1999 03:20:32 GMT |
Here's what I have:
On the stage are five buttons, each of which, "onrelease", is basically supposed
to run a short movie clip (different clip for each button) at a particular (same
for all) spot. See below for complete description of the task I'm trying to
accomplish via Actionscript; but first, a detail about the movie clips:
Each mc is 9 frames long. Frame one has the embedded graphic (of some text)
alphaed back to 0, as does frame 9. In frame 5, graphic has alpha at 100, with a
"stop" on the frame. Tween from frame 1 to 5, and tween again from frame 5 to 9.
So, you see, it is designed to be a "fade in, then (later) fade out" mc.
Okay, now this will make sense. The things to be accomplished "onrelease" are:
- Start old clip at frame 6 and play to the end.
- (*Then, and only then*) remove old clip.
- Duplicate appropriate clip instance, name it "oldclip", place it
appropriately, and play (stops at its frame 5).
Thus, "onrelease", the old clip is *supposed to* finish running to its end
(frames 6-9), so that it appears to fade out, *before* it is removed, and
replaced with the new clip instance for the particular button that was pressed.
In order to try to allow time for the old clip to fade out before being removed,
I've tried building in a "delay" loop (counting) before yanking the old clip.
But it doesn't seem to work. "Onrelease", the clip is removed immediately,
before having a chance to fade out.
Here's my Actionscript:
On (Release)
Begin Tell Target ("oldclip")
Go to and Play (6)
End Tell Target
Set Variable: "x" = 0 \
Loop While (x < 10000) delay loop
Set Variable: "x" = x + 1
End Loop /
Remove Movie Clip ("oldclip")
Duplicate Movie Clip ("advmc", "oldclip", 0)
Set Property ("oldclip", X Position) = "290"
Set Property ("oldclip", Y Position) = "235"
End On
My delay loop doesn't seem to work. The old clip just gets yanked, then the new
one fades in.
Am I going about this the wrong way? A delay loop was the only thing I could
come up with to try to allow the old clip to run to its end before being yanked.
-----
Second, related question:
And, what do people do with the "originals" of the duplicated movie clips ...
hide them off-stage, or what? As I understand it, "duplicate movie clip" needs a
named instance (an "original") to pre-exist somewhere in the movie ... even if
it's never actually been used anywhere else.
Thanks,
Ken Sherwood
*zenkat: the Flash trailer*
http://www.kensherwood.com/zenkat.htm
kensherwood.com
http://www.kensherwood.com
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Streaming Media WEST '99 Conference & Exhibition
"The Worlds largest Internet Audio & Video Event"
December 7 - 9, San Jose Convention Center, California
Reserve your space today at http://www.streamingmedia.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpchinwag [dot] com
Replies
Re: FLASH: Tell Target and Actionscript , unique
Replies
Re: FLASH: unloadmovies., daz
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]