8 Replies Latest reply on May 4, 2008 4:41 AM by multiduck

    Guys I really need help

    shariha
      http://www.designneeds.net/PetIDomatic2.dir

      Here is my file. But I'm getting errors and don't understand how to fix them. Can someone lead me in the right direction please
        • 1. Re: Guys I really need help
          Martin Schaefer Level 1
          Which errors? Please elaborate.

          The only thing I can tell you after 10s is, that you have to learn how to use, define and handle local variables, global variables and properties.

          Cheers,
          Martin
          • 2. Re: Guys I really need help
            shariha Level 1
            I'm getting an error

            Verible used before assigned a value sprite("tag").member = "tag-" & gShape

            Heres my code. I don't understand how to fix

            property pColor

            on getPropertyDescriptionList
            colorList = ["Grey"]
            description = [:]
            description[#pColor] = \
            [#default: colorList[1], \
            #format: #string, \
            #comment: "Select tag color:", \
            #range: colorList \
            ]
            return description
            end

            global gColor

            on beginSprite me
            sprite("tag").member = "tag-" & gShape
            end

            on mouseUp me
            gColor = pColor
            • 3. Guys I really need help
              Chunick Level 3
              I would really suggest re-reading over what I wrote in your original post; it's all there... pick up a Director Lingo book too and use that to help explain in more detail what I wrote... make some smaller, simpler projects out of some of the concepts I wrote about in your original post, ie. break some of the concepts down into smaller, more manageable pieces. All this will help you to understand what I wrote in length... The code you posted shows you don't have understanding of the core concepts - I don't have the time to plan out and write the whole project for you which is essentially what it would take at this point.

              You've jumped into the deep end of the pool - now it's time to start learning how to swim.
              • 4. Re: Guys I really need help
                shariha Level 1
                Thanks for the reply. I do have a few books and I am really trying to understand this. I actually have to have it figured out today so I am freakin out.

                I see where I messed up on some of the code but I have several questions on what you sent me.

                YOUR CODE

                -- behavior script for the 1st section - "Select Design"
                -- for selecting the shape just drop on each of the sprite
                -- tag shapes and select it's appropriate shape
                property pShape

                on getPropertyDescriptionList
                shapeList = ["octagon", "star", "square", "circle", "bone", "heart"]
                description = [:]
                description[#pShape] = \
                [#default: shapeList[1], \
                #format: #string, \
                #comment: "Select tag shape:", \
                #range: shapeList \
                ]
                return description
                end

                global gShape

                on mouseUp me
                gShape = pShape
                go to frame "Select Color" -- earlier, I used these names for the sections
                end

                MY QUESTION - Know I place this on each sprite I also know that we need to tell director what sprite is what shape so I have gone and followed the tag-Bone-Green naming you spoke about.

                However I also know that in that code we must say what tag that is so do I change

                #comment: "Select tag shape:", \ with the tag shape so example #comment: "Bone:", \

                Or am I changing this line description = [:] to be
                description = [Bone]

                I have tried the first way and did not see it work right.

                Next question
                YOUR CODE

                -- behavior script for the 2nd section - "Select Color"
                -- for selecting the color just drop on each of the sprite
                -- color swatches and select it's appropriate color
                property pColor

                on getPropertyDescriptionList
                colorList = ["red", "gray", "orange", "blue", "black", "green"]
                description = [:]
                description[#pColor] = \
                [#default: colorList[1], \
                #format: #string, \
                #comment: "Select tag color:", \
                #range: colorList \
                ]
                return description
                end

                global gColor

                -- in the Property Inspector you can give the sprite a name, but
                -- only in MX2004. It's better to reference by name than number
                -- because if you move the sprite from say, channel 2 to 4 then
                -- your code breaks. Either way is acceptable in MX2004, otherwise
                -- you can only reference by number in earlier versions.
                on beginSprite me
                sprite("tag").member = "tag-" & gShape
                end

                on mouseUp me
                gColor = pColor
                -- I'm not sure here if you want to jump
                -- to the next section or want to switch
                -- the tag colors
                go to frame "Add Description"
                -- or use this script and remove/comment out the above line
                sprite("tag").member = "tag-" & gShape & "-" & gColor
                end


                -- script for the last section - "Add Description"
                -- attach as a behavior on the placeholder large shape
                global gShape
                global gColor

                on beginSprite me
                sprite(me.spriteNum).member = "tag-" & gShape & "-" & gColor & "-large"
                end

                MY QUESTION - Once again I guess I'm changing this line? #comment: "Select tag color:", \ also the way it should work is that they select the color then they will need to click on tag or button to go to the next step of inputting a description

                I saw your code but get an error here
                on beginSprite me
                sprite("tag").member = "tag-" & gShape
                end

                I do have mx2004 and have named a sprite tag like indicated but is that a place holder for where we want the tag to go please explain and let me know

                Lastly I'm not sure what you were asking me when you said this

                The last section of typing the description is a bit tricky for two reasons:
                1) You need to adjust the text area for the shape - you may want to set markers for each shape and jump approprately as it would be the easiest solution - this will require modifying the part of the last script I wrote as an example, but I'll leave it up to you...
                2) You need to set your keyboard to type the appropriate text in the text area... Again, I would use a generic script, make each button a separate graphic and name the button it's appropriate letter, eg. the 'A' button member would be named "A" (without quotes), 'B' button member would be named "B", and so on... then I would use a generic script, something like this to attach to the buttons:

                on keyUp me
                -- assuming the text member where the description is typed
                -- is named "description"
                letter = sprite(me.spriteNum).member.name
                member("description").setContentsAfter(letter)
                end

                I have placed all the buttons in there with that code and I get an error on the description so I am guessing I need to indicate where the description will be with a text field right? And use markers and tell director where to go but how will it know to go to tag-Bone-Green-Large marker?

                I hope you reply for I really need your help
                • 5. Re: Guys I really need help
                  shariha Level 1
                  ok so I am much closer now I figured out what Chunick was talking about on some parts. I was not putting the behaviors in the right place and I ended up duplicating to much. I have fixed that.

                  Questions
                  Getting an error still in the code and two can you explain get a description better
                  • 6. Re: Guys I really need help
                    Chunick Level 3
                    what are the errors, and where are they in the projector (ie. what are the scripts doing?)
                    • 7. Re: Guys I really need help
                      SAYEG
                      well, i've downloaded your file, but i don't understand what are you trying to do; can you explain me what for is your app?
                      sayeg
                      • 8. Re: Guys I really need help
                        multiduck Level 1
                        I'll take the errors as I find them.

                        first in Select Color Behavior
                        script error: variable used before assaigned a value (line 32)

                        1) You haven't set a value for gShape anywhere, I assume from how you have named it that it should be set somewhere else and stored as a global variable. Therefor ad the following line to your code first in your script: global gShape .

                        2) Also the framescript on frame 39 is placed on frame too soon, should probably be on frame 40.

                        3) Error Property not found: #member (same script, line 22)

                        problem here is you don't have a spirte named "Tag", the member it uses might be named Tag but that's not the same thing, go to property inspector and name it Tag

                        That should do it for the errors I can find with the functionality this far. Hope it helps.