Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Importing Photoshop layers
lingo to php with browser on stage
Blur Rollover-Alphamania
Ceiling and floor math functions
Volume Control-Button Only
Hilite Lines - Text and Field
Music Xtra
Installer Vise
Saving Data in Shockwave
Simatrix Menu
 

 

 

Behavior Non-repeating random list

Added on 7/2/1999

 

Compatibilities:
D6_5 D7 D8 Mac PC Script

Rating:

Author: Penworks (website)

Reproduced with permission from Penworks Lingo User"s Journal

-- Source Code from the Lingo User"s Journal
-- Copyright (c) 1995 by Penworks Corporation

-----The movie Script-----

on startMovie
  set audioList =birth(script "randomListMaker", 5)
  set videoList =birth(script "randomListMaker", 5)
  
  repeat with x=1 to 5
    repeat with y=1 to 5
      put getNextRandom(audioList), "<--Audio    Video-->", getNextRandom(videoList)
    end repeat
    put "-------------------------"
  end repeat
  
  set audioList =0
  set VideoList =0
end

-- Object script for randomListMaker
property randomList
property listSize
property nextItem

on birth me, howMany
  set the listSize of me = howMany
  generateList(me)
  return(me)
end

on getNextRandom me
  if the nextItem of me > the listSize of me then
    generateList(me)
  end if
  set thisNumber =getAt(the randomList of me, the nextItem of me)
  set the nextItem of me=the nextItem of me+ 1
  return(thisNumber)
end

on generateList me
  set the randomList of me =[]
  repeat with x=1 to the listSize of me
    addAt(the randomList of me, random(x),x)
  end repeat
  set the nextItem of me  =1
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail