Ask a Question related to Macromedia Director Basics, Design and Development.
-
untaljose #1
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
-
Macromedia Director 5 and Windows XP
Thanks Richie for the info. Regards, Chinmaya -
Macromedia Director mx 2004
How to install Director MX 2004 on Windows 98 operating system -
> 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,... -
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... -
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... -
Andrew Morton #2
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
-
EdMX #3
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
-
Andrew Morton #4
Re: Data types in macromedia director
Maybe the OP needs to discover the duplicate() function?
Andrew
Andrew Morton Guest
-
klgc #5
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
-
untaljose #6
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
-
Andrew #7
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



Reply With Quote

