Flasher Archive

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


Subject: Re: FLASH: action scropt loop not working
From: Randy Kato
Date: Thu, 17 Aug 2000 22:40:32 +0100

Dave,

You're on the right track, but you'll need to use a MC to control the
alpha. A Loop While is just going to keep looping as fast as the
processor can go so you'll wind up with what looks like an instantaneous
change from 99% to 5%. With a timeline-based loop you'll get a gradual
fade down.

Your controller MC will have a script in, say, frame 2 that sets the
alpha to alpha - 5 or something (you can play with how much to subract
to adjust how fast it fades). Then a frame or so later (you can play
with how many frames later to adjust the speed of the fade) you'll have
an If statement that checks if alpha is <= 5. If it is, Tell target the
timeline you want to move to Go to and Stop (10). If it isn't, Go to and
Play (2) to keep looping. In frame one of the controller MC you can set
your variable and then just have a Stop action so it won't do anything
until you want it to.

So here's an example of your controller MC, Frame 1:

Stop
Set Variable: "newAlpha" = 99

Frame 2:

Set Variable: "newAlpha" = newAlpha - 5
Set Property ("/bar2", Alpha) = newAlpha

Frame 4 or so:

If (newAlpha <= 5)
Begin Tell Target ("/")
Go to and Stop (10)
End Tell Target
Go to and Stop (1)
Else
Go to and Play (2)
End If


Keep a close eye on the syntax because you need to make sure expressions
are being interpreted as such and not just seen as string literals.

Hope this makes sense to you.

HTH,
Randy


Dave Simpson wrote:

> I was hoping someone could help me out here. I am trying to
> make a loop in action script. A simple alpha fade down from
> 99 to 5 and then goto another frame(just to let me know its
> working). Please help me. I have been working on this for a
> while now and can't figure it out. This is my code so far.
> "bar2" is the name of the movie clip.

--
'''''' ' ' ' ' ' ' ' ' '
Randy Kato - Web Master
Braincraft

627 Broadway, Suite 504, NYC 10012
T 212.539.1680 F 212.539.1741
http://www.braincraft.com
...... . . . . . . . . .



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NudeGuru.com is proud to sponsor the Flasher list
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IT'S THE ART OF MONEY, HONEY!
Tips and Advice from some of the most popular Flash
artists + industry power-brokers on how to hold onto
your rights, negotiate contracts and get full value
for your work.http://www.nudeguru.com from Franke James
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  FLASH: Oh my God..., Christopher Gray
  Re: FLASH: action scropt loop not workin, Dave Simpson

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