Ask a Question related to Macromedia Director Lingo, Design and Development.
-
Christian Grass #1
getPropertyDescriptionList --> pass a variable instead of concrete value?
Hi Folks!
I have the following code within a behaviour:
-----------------------------------------
on getPropertyDescriptionList
pList = [:]
pList.addProp(#pListBox,[#default:VOID, #format:#object,
#comment:"Global Reference to a Listbox Object:"])
pList.addProp(#pItemList,[#default:VOID, #format:#list,
#comment:"Itemlist:"])
return pList
end
----------------------------------------
And in my movie script:
gListBox = script("listbox").new()
gUserList = getUsers()
----------------------------------------
When the according dialog appears by dragging the behaviour on a sprite:
Then I want to type "gListBox" into the property field for "#pListBox",
and "gUserList" for "#pItemList".
Unfortunately those variables are not taken as variables and my code can't
work.
How can I make Lingo consider it as a variable or the value of the
variable? I guess, I have to do some kind of type conversion?
Christian Grass Guest
-
The variable won't pass
The problem I am having is with setting a variable which would hold an id and it would be used on multiple pages. The variable should change when... -
Login needs to pass variable
The profile form CFINCLUDEs the login page in the header. If I attempt to view the profile.cfm?userID=XX I am switched to the login form as... -
Try to pass variable into a php script
I am not sure how you used javascript to submit the form. I usually do like document.form.action = "/cgi-bin/register.pl"... -
[PHP] Still can't pass variable through url
<?php $year=1999; $month=march; echo "<a href=\"http://www.thingamajigger.com/index.php?year=$year&month=$month\" ?> -
Can't Pass variable to other page
Jack wrote: IIRC, a default installation does not automatically make global variable ou of GET parameters. try: <? echo $_GET.'<br />'; echo... -
Christian Grass #2
Re: getPropertyDescriptionList --> I solved it, but I don't know why...
I am happy that I finally was able to solve this.
Don't ask me why this is working. I just had a bunch of ideas how it might
work and found out by trial & error.
The point was that I had to give it as objects and then pull out the
references by using the keyword "value".
Now, I would be pleased to get also logically behind this. I understand it
to some extent, but I am missing the final enlightenment, because I
couldn't find this documented in any macromedia technote or somewhere else.
Here's the code:
----------------
on getPropertyDescriptionList
pList = [:]
pList.addProp(#pListBox,[#default: void, #format:#object,
#comment:"Listbox Object:"])
pList.addProp(#pItemList,[#default: void, #format:#object,
#comment:"Itemlist:"])
return pList
end
on beginSprite me
pItemList = pItemList.value
pListBox = pListBox.value
....
Christian Grass Guest
-
Andrew Morton #3
Re: getPropertyDescriptionList --> I solved it, but I don't know why...
Director doesn't know that you are putting a variable name in as a property so
you have to use value() to interpret the string as a variable name. Fortunately,
using value that way avoids the pitfalls encountered if a list has a void value
or a quote inside a string:
x=[void, 1 , "ab" & quote & "c"]
put value("x")
-- [<Void>, 1, "ab"c"]
s=string(value(x))
put s
-- "[<Void>, 1, "ab"c"]"
y=value(s)
put y
-- <Void>
This may give you some ideas:
-- Welcome to Director --
a=123
b="hello"
put (the globals)[#a]
-- 123
varname="b"
put (the globals)[symbol(varname)]
-- "hello"
Andrew
Andrew Morton Guest
-
Christian Grass #4
Re: getPropertyDescriptionList --> I solved it, but I don't know why...
thank you!
Christian Grass Guest
-
Christian Grass #5
Re: getPropertyDescriptionList --> I solved it, but I don't know why...
thank you!
Christian Grass Guest



Reply With Quote

