I know this will sound stupid, cause I always take the most complicated way 
to do the things, but I'll give a shot...

first I would set some global variables, like hotspot1state, hotspot2state, 
hotspot3state and hotspotsfilled and some properties, like item1, item2, 
item3, hotspot1, hotspot2 and hotspot3 (being the property, each one's 
sprite number) and originalitem1Vposition, originalitem2Vposition, 
originalitem3Vposition, originalitem1Hposition, originalitem2Hposition and 
originalitem3Hposition (being the property the item's initial locV and locH).

I'll assume that the items' loch are always the same after putting them in 
the match boxes and the item locv is different (like they were aligned to 
the left, and one below the other)...

I'll also assume that item1 right position is on hotspot1 and so on...
then I would put an if statement on mouse up, for all items sprites, like this:

-- checks if there is an item in hotspot1 and sets the hotspot1state variable.
if item1.locv = hotspot1.locv or item2.locv = hotspot1.locv or item3.locv = 
hotspot1.locv then
    hotspot1state = 1
else
    hotspot1state = 0
end if
-- checks if there is an item in hotspot2 and sets the hotspot2state variable.
if item1.locv = hotspot2.locv or item2.locv = hotspot2.locv or item3.locv = 
hotspot2.locv then
    hotspot2state = 1
else
    hotspot2state = 0
end if
-- checks if there is an item in hotspot3 and sets the hotspot3state variable.
if item1.locv = hotspot3.locv or item2.locv = hotspot3.locv or item3.locv = 
hotspot3.locv then
    hotspot3state = 1
else
    hotspot3state = 0
end if
-- checks if all hotspots are filled and sets variable hotspots
if hotspot1 + hotspot2 + hotspot3 = 3 then
   hotspotsfilled = 1
else
   hotspotsfilled = 0
end if

-- then you can put this in a confirm button, or just go on with the code 
above...

-- checks if all hotspots are filled
if hotspotsfilled = 1 then
    -- checks if all items are in their right places. If so, a message is 
displayed.
    if item1.locv = hotspot1.locv and item2.locv = hotspot2.locv and 
item3.locv = hotspot3.locv then
       alert "Congrats. All answers are right."
    else
    -- checks which items are in the wrong place and puts it back to its 
original place and displays a message to try again.
        if item1.locv <> hotspot1.locv then
           item1.locv = originalitem1Vposition
           item1.loch = originalitem1Hposition
        end if
        if item2.locv <> hotspot2.locv then
           item2.locv = originalitem2Vposition
           item2.loch = originalitem2Hposition
        end if
        if item3.locv <> hotspot3.locv then
           item3.locv = originalitem3Vposition
           item3.loch = originalitem3Hposition
        end if
        alert "Some answers were wrong. Please try again."
    end if
end if

I think this should work fine, but like I said before, I always do things 
in the hardest way. If you got lost or missed some part of it, just e-mail 
me and I'll try to explain it in a... huh... simple way...

Catch ya later...
Fabio Grachiki
[EMAIL PROTECTED]


At 01:59 10/12/00 -0800, you wrote:
>hi all,
>
>i have to make a match question which consist of 3
>items and 3 hot spots, where i have to drag the items
>onto. now this is the case: normally , if you put a
>wrong item on a hotspot (it doesn't match) then it
>would move back to startposition. But what i need is
>that the check (of right/wrong) is after the user has
>put all 3 items on the hotspots......and then only the
>wrong ones go back. Then there will be a 2nd chance
>which enables the user to get it right (with the items
>which were wrong placed).
>
>can anybody give me some hints how to do it ?
>
>thanx,
>
>Tim.
>


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to