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

  1. #1

    Default 'Remembering'

    Im creating a 10 question quiz consisting of drag and drops, multichoice,
    inputs boxes etc.

    I can get each questions to work right at the time, but if the user goes back
    to the question afterwards alot of the items are reset. Take for example a
    drag and drop:
    they do the drag and drop, click check answer and feedback appears.

    Now dont get me wrong, i dont want them to be able to redo the question but
    merely that the drag and drops remain in the positions where they were when the
    'check answer' was clicked so that they know how they answered.

    This is the code I have on my drag and drops, a bit of a work around I know
    but i am not very good:

    property originalLoc

    on beginsprite me
    originalLoc=sprite(me.spriteNum).loc
    pMySpriteRef = sprite(me.spriteNum)
    end

    on mouseUp me
    pMySpriteRef = sprite(me.spriteNum)
    if sprite pMySpriteRef intersects 28 then
    sprite(pMySpriteRef).locH = 263
    sprite(pMySpriteRef).locV = 240
    else if sprite pMySpriteRef intersects 29 then
    sprite(pMySpriteRef).locH = 263
    sprite(pMySpriteRef).locV = 281
    else if sprite pMySpriteRef intersects 30 then
    sprite(pMySpriteRef).locH = 263
    sprite(pMySpriteRef).locV = 322
    else if sprite pMySpriteRef intersects 31 then
    sprite(pMySpriteRef).locH = 263
    sprite(pMySpriteRef).locV = 363
    else
    sprite(pMySpriteRef).loc=sprite(pMySpriteRef).orig inalLoc
    end if
    end


    And this is the code on my check answer button:

    global gScore

    on mouseUp me
    if sprite 28 intersects 21 then
    member("Q1Feedback").line[1] = "Well Done. You got Access correct."
    gScore = gScore + 1
    else
    member("Q1Feedback").line[1] = "Bad Luck. Access is database software."
    end if

    if sprite 29 intersects 25 then
    member("Q1Feedback").line[2] = "Well Done. You got Publisher correct."
    gScore = gScore + 1
    else
    member("Q1Feedback").line[2] = "Bad Luck. Publisher is desktop publsihing
    software."
    end if

    if sprite 30 intersects 24 then
    member("Q1Feedback").line[3] = "Well Done. You got Powerpoint correct."
    gScore = gScore + 1
    else
    member("Q1Feedback").line[3] = "Bad Luck. PowerPoint is presentation
    software."
    end if

    if sprite 31 intersects 26 then
    member("Q1Feedback").line[4] = "Well Done. You got Word correct."
    gScore = gScore + 1
    else
    member("Q1Feedback").line[4] = "Bad Luck. Word is word processing
    software."
    end if

    put gScore into field "result"

    sprite(40).locH = 900 --moves the 'check answer' button off screen leaving
    picture underneath visible
    sprite(40).locV = 700

    sprite(21).moveableSprite = FALSE --makes drag and drop objects unmovable
    sprite(22).moveableSprite = FALSE
    sprite(23).moveableSprite = FALSE
    sprite(24).moveableSprite = FALSE
    sprite(25).moveableSprite = FALSE
    sprite(26).moveableSprite = FALSE

    end


    So basically, im asking how can I get my drag and objects to then remain
    unmovable, in the same location and that the check answer button remains off
    screen.

    Im pretty sure it doesnt remember because I perform actions on sprite numbers
    and not the members themselves. It resets when the sprite in that channel
    changes because the feedback box which is referred to as
    member("Q1Feedback").text does retain its contents.

    Im sorry for the appalling, long-winded explanation but I hope somebody
    understands the gist of what I am saying. Now i dont know whether the solution
    is very simple or extremely complicated. If its the latter then just saying so
    will will suffice and I will simply leave it as it stands. At least it works,
    thats the important thing.


    Thanks in advance.

    _Ashley_ Guest

  2. Similar Questions and Discussions

    1. Page seems to be remembering HttpSessionState
      I have a page that determines some of what to display based on HttpSessionState. When I go to it the first time, it displays everything the way I...
    2. page remembering old values ...?
      Hello people, once again I am here to ask you for your help. This time I am working on an online shop for a hospice, I am trying to set up a page...
    3. Remembering Passwords
      Every time I access a password-protected resource on the Web, I am prompted to enter my username and password. I do so then click "remember...
    4. System Restore not remembering
      I have my system restore set to use the maximum amount of disk space allowed (12%) which is over a gig for each partition. But when I check the...
    5. Remembering the level of brightness
      Everytime I boot up my laptop it defaults it's brightness to max, which I need to adjust down. This happens when I switch user as well. Any way...
  3. #2

    Default Re: 'Remembering'

    Here's one possible scheme, additions have ***


    property originalLoc
    property doneList -- ***

    on beginsprite me
    originalLoc=sprite(me.spriteNum).loc
    pMySpriteRef = sprite(me.spriteNum)
    doneList = [] -- clean history ***
    end

    on mouseUp me
    pMySpriteRef = sprite(me.spriteNum)
    if sprite pMySpriteRef intersects 28 and not getPos(doneList , 28)
    then -- ***
    sprite(pMySpriteRef).locH = 263
    sprite(pMySpriteRef).locV = 240
    append doneList, 28 --***
    else if sprite pMySpriteRef intersects 29 then
    --*** and the same for the rest



    here's donlist after a few rollovers

    [29, 29, 30]

    maybe a diffent history list foe click handling, you work it out...
    JB 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