Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
MediaMacros Blog
Xtras Mall From MediaMacros
Image Flood Fill (Using getPixel and setPixel)
Halo around images
Volume Behaviour (Buttons)
Sneakers
DragNDrop Behaviour
Happy Hour Fonts
Simple Distance Blend
Curve Sprite - Move a sprite along a curved path.
MediaMacros Xtras Mall
 

 

 

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

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail