Flasher Archive

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


Subject: RE: FLASH:scripting movement?
From: Paul Willoughby
Date: Thu, 21 Dec 2000 16:45:37 GMT

Hi Bill

A really good place to start for this kind of thing is
www.moock.org/webdesign/flash . His tutorials on programmatic movement
are very simple and very clear. There's also some really good tutorials
at www.flashkit.com , just look in the scripting section.
Another thing you should be aware of is that Flash 5 has considerably
more sophisticated code for doing this kind of thing, like you can know
script colour changes.

As a little taster, here's a script for moving a clip horizontally
across the screen. It's all 'bout GetProperty and SetProperty (which you
can read about in the manual). This would be a movie clip with just 2
frames of code that moves another clip on the main timeline called
"myClip":

Frame 1:

SetProperty("/myClip", _y) = GetProperty("/myClip", _y) + 5

Frame 2:
SetProperty("/myClip", _y) = GetProperty("/myClip", _y) + 5
GotoAndPlay(1)

Basically you're just telling a movie clip to move to it's current
position plus five pixels every frame. To speed up the movement, just
increase the amount you move it each time (distance logically maps to
speed with vectors) or increase the frame rate of your movie. If you
replaced "_y" in the above code with "_rotation" you'd cause the clip to
rotate at 5 pixels a frame (there is a bug with the rotation property
however. You have to reset the scale of your clip
(SetProperty("/myClip", _scale) = 100) every frame or it starts
shrinking!)

hth

paul

> -----Original Message-----
> From: Bill Gunter [billgatistreaminteractive [dot] com (mailto:billgatistreaminteractive [dot] com)]
> Sent: 21 December 2000 17:33
> To: flasheratchinwag [dot] com
> Subject: RE: FLASH:scripting movement?
>
>
> Hello everyone,
>
> I consider myself to be a pretty good flash designer and
> animator but lately
> I have been trying to delve into the scary world of action
> scripting, as it
> is necessary to make things work the way I need them to. My
> question is, is
> there an effective way to replace some basic tweening with
> action scripting?
> I have noticed that most movement that has been scripted
> moves very smoothly
> and saves a conciderable amount of file size. If so could you
> please give me
> some examples of scripts for something like rotating an
> object at a certain
> speed or adding a random alpha tween between 10% and 90%,
> something I can
> work with to better understand scripting. It is critical that
> I learn this
> and I appreciate any help that you all can give.
>
> Thanks in advance,
> Bill
> iStream Interactive
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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: Is it possible to change the icon, frederic gontier

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