Flasher Archive

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


Subject: Re: FLASH: Flash 5 Beginner's Problem
From: Helen Triolo
Date: Thu, 14 Dec 2000 19:33:09 GMT

Mike,

To move clips across the stage, you should put code into the Object
Actions of either the clips themselves or or a controller clip (probably
the latter, since you want to move all 6 at once). Create a movieclip
with nothing in it, drag it onto the stage, hit ctrl-alt-a to open the
actions window if it's not already open and make sure you're entering
code into the Object Actions panel (not Frame Actions). The code should
be something like

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

This will make the 6 objects move 5 pixels right in a loop (because the
controller movieclip will loop even it's only one frame long in Flash 5)
If you want more explanation about why the _root["square"+i], I
attempted to explain it in a tutorial at Flashkit:
http://www.flashkit.com/tutorials/5_ad_piect/tute_piechart.shtml

Regards,
Helen
-----------------------------------------------------
i-Technica � http://i-technica.com � 301.424.6037
developer resources: http://i-technica.com/whitestuff

Mike Kelly wrote:
>
> Hope someone can help!
>
> 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.
> 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?
>
> Suggestions gratefully received.
>
> Mike
>
> PS. Sorry if you have received this multiple times - it's not coming through
> to my mailbox, so I'm trying different setttings.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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: Flash 5 Beginner's Problem, Mike Kelly

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