getPropertyDescriptionList --> pass a variable instead of concrete value?

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

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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"...
    4. [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\" ?>
    5. 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...
  3. #2

    Default 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

  4. #3

    Default 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

  5. #4

    Default Re: getPropertyDescriptionList --> I solved it, but I don't know why...

    thank you!
    Christian Grass Guest

  6. #5

    Default Re: getPropertyDescriptionList --> I solved it, but I don't know why...

    thank you!
    Christian Grass 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