Data types in macromedia director

Ask a Question related to Macromedia Director Basics, Design and Development.

  1. #1

    Default Data types in macromedia director

    Hello, I have to use data types with macromedia director and I don't
    know how can I do it.
    I want to simulate a matrix. I do it with lists but it does'nt work:

    cell = [integer,integer]
    column = [cell,cell,cell,cell,cell,cell,cell,cell,cell,cell]
    matrix = [column,column,column,column,column,column,column,c olumn,column,column]

    Thanks,

    Untaljose.
    untaljose Guest

  2. Similar Questions and Discussions

    1. Macromedia Director 5 and Windows XP
      Thanks Richie for the info. Regards, Chinmaya
    2. Macromedia Director mx 2004
      How to install Director MX 2004 on Windows 98 operating system
    3. > Bug in Director - Attn Macromedia <
      Sorry, I'm not sure how to enter bugs. :) In Director MX if you are creating an HTML Table on the fly using the Put X after html command lines,...
    4. Question re FH MX 11.01 for John or any Macromedia Types
      Howdy. I'm a registered FH10 user. If I go and buy the upgrade box for FH MX (1) is there a hard-copy manual for it and (2) Will it still more or...
    5. macromedia.director.lingo
      Hello, quite an annoying problem: I'm using an internal (linked) Director movie to display a list of text members. When the user clicks on one of...
  3. #2

    Default Re: Data types in macromedia director

    > I want to simulate a matrix. I do it with lists but it does'nt work:

    In what way does it not work?
    Incidentally, you can use the point(x, y) data structure to hold two variables.

    Andrew
    Andrew Morton Guest

  4. #3

    Default Re: Data types in macromedia director

    There's no reason why this should not work. In fact if you open a new movie and
    put this code into a movie script:

    global cell, column, matrix

    on startmovie
    cell = [1,0]
    column = [cell,cell,cell,cell,cell,cell,cell,cell,cell,cell]
    matrix =
    [column,column,column,column,column,column,column,c olumn,column,column]
    end

    then run the movie - Then open the message window and type:

    put matrix

    you will see your lovely nested array in perfect order.

    This means your problem is probably the way you've written the code that sets
    the arrays up and populates them. This is understandable as lingos array
    handling methods are hideously vebose and easy to get wrong.

    The solution is to break down the code you use to make your arrays into very
    small steps - dont try to do too much in one line of code - and test the value
    of your arrays at each stage (by putting the results in the message window or
    using the object inspector) this way you can isolate the process that is
    causing the trouble and (hopefully) fix it.

    EdMX Guest

  5. #4

    Default Re: Data types in macromedia director

    Maybe the OP needs to discover the duplicate() function?

    Andrew
    Andrew Morton Guest

  6. #5

    Default Re: Data types in macromedia director

    If you want to see an example of using lists for matrices and a simple recursive solution technique then see:

    [url]http://www.director-online.com/buildArticle.php?id=1132[/url]
    klgc Guest

  7. #6

    Default Re: Data types in macromedia director

    "Andrew Morton" <co.uk.invalid> wrote in message news:<c78g0s$kuc$macromedia.com>... 

    How can I take the value of a cell?
    I have the next code to prove my matrix:

    global cell,column,matrix
    on mouseup
    matrix [1][8][1] = 1
    if matrix [1][8][1] then
    alert "funciona"
    end if
    end

    This code compiles but when I execute it, the next message appears:

    script error: Object expected

    matrix[1][8][1]=1

    and I have not idea why it occurs!

    Thanks a lot for your help,

    ~untaljose
    untaljose Guest

  8. #7

    Default Re: Data types in macromedia director

    It sounds like you haven't initialized the list "matrix".
    Try this to create a 10x10 zero matrix of points:-

    -------------------------------------
    global matrix

    on createZeroMatrix
    cell=[0,0]
    column=[]
    matrix=[]
    repeat with i=1 to 10
    add column, duplicate(cell)
    end repeat
    repeat with i=1 to 10
    add matrix, duplicate(column)
    end repeat
    end createZeroMatrix
    -------------------------------------

    -- Welcome to Director

    createZeroMatrix()
    put matrix
    -- [[[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0,
    0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
    [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0,
    0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
    [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0,
    0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
    [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0,
    0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
    [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0,
    0], [0, 0], [0, 0], [0, 0], [0, 0]], [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
    [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]]]
    matrix[5][2][1]=1
    put matrix[5][2]
    -- [1, 0]

    Andrew

    Andrew Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139