Flasher Archive

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


Subject: Re: FLASH: Controlling random event
From: Nathan Dicken
Date: Fri, 5 May 2000 14:26:50 +0100

Hi Danelle,

Here's a technique that you could use... Put this script on a button and
duplicate the button in four frames, moving the button to different places
for each frame. Also put a Stop action on each frame.

On (Roll Out)
Set Variable: "framelist" = ""
Set Variable: "n" = "1"
Loop While (n <= 4)
If (n <> _currentFrame)
Set Variable: "framelist" = framelist & n
End If
Set Variable: "n" = n+1
End Loop
Trace ("current frame: "&_currentFrame&" / others: "&framelist)
Set Variable: "rIndex" = random(length(framelist))+1
Set Variable: "rFrame" = int(subString(framelist,rIndex,1))
Go to and Stop (rFrame)
End On

Overall, the technique is to create a small list of available frames (other
than the current one) and choose a random from those. Try it out if you
have a chance and let me know if any of this is confusing...

Nathan Dicken
Fusionary Media


>Hello,
>
>I'm only just starting with programming and have a written a little script
>that almost does what I want it to do.
>
>I've created 4 buttons in 4 frames which, on roll out, make the playhead
>jump at random to one of the 4 frames in the movie clip. I want a different
>frame to play then the one from which the action was triggered, otherwise
>nothing seems to happen. This is the script I use:
>
>On (Roll Out, Drag Out)
> Set Variable: "frameno" = GetProperty ("", _currentframe )
> Go to and Stop ("1" & Random(4) + 1)
> If (GetProperty ("",_currentframe) eq frameno)
> Go to and Stop ("1" & Random(4) + 1)
> Else
> Stop
> End If
>End On
>
>This isn't quite working, somtimes it still plays the same frame. I think I
>need to work with a loop but I don't know how that works.
>
>Can anyone help?
>Thanks in advance, regards, Danielle.
>
>
>
>flasher is generously supported by...
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Get the last 100 messages from the flasher list NOW
> http://www.chinwag.com/flasher/last100.shtml
>
> Flash books http://www.chinwag.com/flasher/books.shtml
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>To unsubscribe or change your list settings go to
>http://www.chinwag.com/flasher or email helpatchinwag [dot] com



flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the last 100 messages from the flasher list NOW
http://www.chinwag.com/flasher/last100.shtml

Flash books http://www.chinwag.com/flasher/books.shtml
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  FLASH: Controlling random event, Danielle Roberts

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