Ask a Question related to Macromedia Director Basics, Design and Development.
-
_Ashley_ #1
'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
-
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... -
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... -
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... -
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... -
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... -
JB #2
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



Reply With Quote

