Flasher Archive

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


Subject: RE: FLASH: Flash 5 Beginner's Problem
From: Paul Willoughby
Date: Fri, 15 Dec 2000 16:04:27 GMT

Mike Kelly wrote on 14 December 2000:
> I have six movie clips ("square1" - "square6") on six layers
> in my main timeline. In the first frame of my "actions" layer I have:
>
> for (i=1; i<=6; i++) {
> setProperty (("square" + i), _x, ("square"+i)._x+5);
> }
>
> Then in the 10th frame of the "actions" layer, I ask the
> movie to goto 1 and play.
> Unfortunately, instead of moving the clips by 5 pixels every
> loop, this moves the whole lot off screen in one go.

I had a problem like this. It might help to use Eval. The syntax is
something like this:

for (i=1; i<=6; i++) {
setProperty (Eval("_root.square" + i), _x,
Eval("_root.square"+i)._x+5);

Or even better, you could try it with the new array syntax which usually
works like a charm:

for (i=1; i<=6; i++) {
_root["square" + i]._x = (_root["square" + i]._x + 5)

> Should my first bit of code be in a handler of some kind?
> Why are the "on" and "onclipevent" handler options dimmed in
> my action code window?

"onclipevent" can only be added to the object actions for an instance of
a movie clip, like load, enterFrame etc. "On" is for button instance
actions like press, release etc. You can't add either of these actions
to frames.

hth

paul

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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


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