Ask a Question related to Macromedia Director Lingo, Design and Development.
-
meeesta webforumsuser@macromedia.com #1
List Related Fun
Hello,
Coming from a flash background I'm always trying to recreate things that seemed simple in Flash's actionscript in Director. I'm using 8.5 and what I'm trying to create is a 2 dimensional array..
In Flash it was as easy as:
function createObject(objA, objB){
this.objA= objA;
this.objB= objB;
}
var anArray = new Array(2);
anArray[0] = new createObject("Bob","Uncle");
anArray[1] = new createObject("Brad","Village Idiot");
Once this was set finding an object was easy...
anArray[1].objB would equal "Village Idiot".
So its this I'm trying to achieve, an easy way to create a 2D array, populate it and then how to access it... I've been looking everywhere for pointers but there are only notes on one dimensional arrays (straight forward lists).
Any pointers would be greatly appreciated on this matter.
Many thanks for your time,
Meeesta
meeesta webforumsuser@macromedia.com Guest
-
ASP Coding Problem, XMLDOM-related (or just language-related!)
Hi, I'm hoping someone can help me with this problem. I'm not sure whether the problem lies with the software or with my understanding of the... -
IE7 Related
Should I upgrade the IE7 version that shipped with Windows Vista Feb06 CTP or is it the latest and/or the only version that can work with this build... -
Multi-line TextBox - Paste text with numbered list, bullet list, tab character
Hi All, I need a server control that's exactly like a multi-line TextBox, but also allow users to paste text with numbered list, bullet list, and... -
#25625 [NEW]: [chm] bug on ref.ftp.html | ftp_*list cant retrive ftp list on some ftpd
From: sentomas at hotmail dot com Operating system: freebad PHP version: 4.3.3 PHP Bug Type: FTP related Bug description: ... -
Subset of values in value list - related only
Chris: Thank you so much for your help. I found an article on the FM site as you suggested that I think will answer all my questions. Regarding... -
Word of Mouth Productions #2
Re: List Related Fun
> Coming from a flash background I'm always trying to recreate things that
seemed simple in Flash's actionscript in Director. I'm using 8.5 and what
I'm trying to create is a 2 dimensional array..
I didn't know you could use Flash's actionscript in Director. ;)
Since I don't know Actionscript well, I can only guess what this array
actually looks like. So I'm going to take a stab. Are the entries "bob"
and "uncle" representing a property/data pair?
If so then you'd want a property list
propList = [:]
propList.addProp ("Bob", "Uncle")
propList.addProp ("Brad", "Village Idiot")
or you could hard code it as
propList = ["Bob": "Uncle", "Brad": "Village Idiot"]
You would access the pairs several ways but one way is:
propList ["Bob"]
which would equal "Uncle"
but you could also get values by position, get properties by value, etc.
A true two dimensional array would look something like:
twoDimArray = [["Bob", "Uncle"], ["Brad", "Village Idiot"]]
or could be assembled:
twoDimArray = []
twoDimArray.add (["Bob", "Uncle"])
twoDimArray.add (["Brad", "Village Idiot"])
In this case you could access values by number or find a values position
twoDimArray [1] would give ["Bob", "Uncle"] but
twoDimArray [1][2] would give "Bob"
twoDimArray.getOne (["Bob", "Uncle"]) would give 1 as a result
populate it and then how to access it... I've been looking everywhere for>
> In Flash it was as easy as:
>
> function createObject(objA, objB){
>
> this.objA= objA;
> this.objB= objB;
>
> }
>
>
> var anArray = new Array(2);
> anArray[0] = new createObject("Bob","Uncle");
> anArray[1] = new createObject("Brad","Village Idiot");
>
> Once this was set finding an object was easy...
> anArray[1].objB would equal "Village Idiot".
>
> So its this I'm trying to achieve, an easy way to create a 2D array,
pointers but there are only notes on one dimensional arrays (straight
forward lists).>
> Any pointers would be greatly appreciated on this matter.
>
> Many thanks for your time,
> Meeesta
>
>
Word of Mouth Productions Guest
-
meeesta webforumsuser@macromedia.com #3
Re: List Related Fun
Thanks for the responses... I've actually managed to get a 2d 'array' (okay list) running in Director now.. and how to collect info from it.
Now at the moment I've got a list drives on the users machine, now what I want to do is check each one individually for type and size.. And thanks to buddy API I can do that...
discsList = baDiskList()
which gives me a list of -
discsList[1] = "A:\"
discsList[2] = "C:\"
discsList[3] = "D:\"
discsList[4] = "E:\"
discsList[5] = "F:\"
Now obviously this will change from machine to machine so the length of the list will change. How do I extract this?
The previous example I gave from Flash (by the way I'd never try Actionscript in Director ;-)) -
var anArray = new Array(2);
anArray[0] = new createObject("Bob","Uncle");
anArray[1] = new createObject("Brad","Village Idiot");
To get the length of this was as easy as -
var arraySize = anArray.length
which in this case would return a length of 2. I tried discsList.length -
repeat with i = 1 to discsList.length
-- Lingo of a madman --
end repeat
(okay so I did try a little Actionscript in Director) but with the predictable errors and flames from the keyboard.
So again in a nutshell how do create a repeat with loop with the maximum loop value being the last list element?
If you can answer this I promise I'll leave you all alone.
Thanks for your time.
Cheers,
Meeesta
meeesta webforumsuser@macromedia.com Guest
-
meeesta webforumsuser@macromedia.com #4
Re: List Related Fun
Oooops.. found it..
..count
If anyone already posted a response, thanxs anyhow.
meeesta webforumsuser@macromedia.com Guest



Reply With Quote

