Flasher Archive

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


Subject: RE: FLASH: shaking an instance
From: Paul Willoughby
Date: Wed, 8 Nov 2000 11:15:43 GMT

Hi Ben,

By the look of your script, the code for movement is in there as strings
instead of expressions. Make sure all your variable values and moving code
are expressions (the litle button next to the fields controls this). The cut
n pasted code should look like:

Set Variable: "horiz" = GetProperty("../shake", _x)
Set Property ("../shake", X Position) = horiz + 15

(note the lack of quotations)

This code could be simplified to:

Set Property ("/shake", X Position) = GetProperty("/shake", _x) + 15

If all your shake MC is on the main timeline you don't need the '..'

Another thing is that your going to need at least 3 frames in your shake
routine. Make frame 1 blank, then put your move left in the next frame and
move right in the frame after that. Make sure you add the goto and play (1)
at the end of the frame 3 code. (aside: I also would have thought this code
would only need 2 frames to execute continuously, but I've tested and it
needs a blank first frame or final frame, don't ask me why!)

If you wanted to apply this effect to multiple objects the best way would
definitely be a loop. Sumink like:

Loop While (i <= /:totalObjects)//where totalObjects is a variable set on
the main time line//
Set Variable: "i" = i + 1
Set Property ("/shake" & i, X Position) = GetProperty("/shake" & i,
_x) + 15
End Loop
Set Variable: "i" = 0

(note both the target and position code are expressions)

I have a FLA demonstrating these principles. Mail me off list if you'd like
a copy.

Sadly, you won't get a blur effect with this code :-( To achieve something
like that would be a lot more complicated. Theoretically the best way would
be to leave a trail of duplicates who's alpha gradually fades to 0. You
might get some ideas for the code to do this by going to flashkit.com and
looking at their mouse trailers as some of them work on this principle.

hth

paul






From: Ben Houghton wrote on 07 November 2000:
>
> hi there
>
> i'm currently trying to create a little script that can be applied to
> multiple layers of a movie which shakes the instance found in that
> particular layer (or ideally on script which shakes all the instances
> together).
>
> unfortunately i am not doing very well :-(
>
> within my main 30 frame looped movie i have created a simple
> rectangle which
> is a movie clip called Shake instance name Shake, which
> contains two frames
> each containing the frame scripts as follows
>
> Set Variable: "horiz" = "GetProperty(../Shake,_x)"
> Set Property ("../Shake", X Position) = "horiz+15"
>
> and in the second frame
>
> Set Variable: "horiz" = "GetProperty(../Shake,_x)"
> Set Property ("../Shake", X Position) = "horiz-15"
>
> I know the targeting is OK because when I take out the horiz
> from the set
> property the thing moves.
>
> I guess it's something to do with my syntax but what?
>
> Also it seams far too slow - I want it to blur really - is
> this achievable
> or do I need to think again?
>
> And finally :-) how would I easily apply this to a movie
> which contains lots
> of different things in different layers all that I want to
> shake - do I need
> to increment a name variable (e.g. target Shake1, Shake 2
> etc.) but this
> seams clumsy - is there a better way?
>
> Thanks in advance!
>
> Ben Houghton
> benata-eye [dot] com
>

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