Where did all my images go??

Judy Perry jperryl at ecs.fullerton.edu
Sun Sep 1 18:14:01 EDT 2002


Hi again,


> I just tried your recipe and got a good result:
<snip>
> How different is this recipe from what you're doing?
>

--It's not.  I think it's safe to say that it is far more likely that I
did some dumb *ss thing such as move the images without thinking about it
than that I alone have some weird problem.  It's not my recollection, but
I wouldn't want to base any mission-critical system on my memory.  Still,
when I move a copy of said graphic back to its original location, no
picture.

> You should.  I've been doing it here for years.  What does the script that's
> not performing as you'd expect look like?

Okay, here goes.  On some card, I used the File -> Import as Control menu
command to successively import the following:  "gryffindor.gif",
"slytherin.gif", "hufflepuff.gif", & the other one.. uh.. oh yeah,
"ravenclaw.gif".

I layer them on top of one another so that when they are to be made
visible, they will occur in the correct (same) location.  I then
successively double-click each image to get its properties palette,
unclick the "visible" property and rename each successively as
"Gryffindor", "Slytherin", "Hufflepuff" and "Ravenclaw".

I then open the card with this script:

on openCard
  global theHouse
  if theHouse = "Gryffindor" then
    set the visible of image "Gryffindor" to true
    put "You belong in Gryffindor!  Where dwell the brave at heart.  Their
daring, nerve and chivalry .  Set Gryffindors apart. " into cd fld
"HouseInfo"
end if

if theHouse = "Hufflepuff" then
    set the visible of image "Hufflepuff" to true
   put "You belong in Hufflepuff!  Where they are just and loyal.  Those
patient Hufflepuffs are true, and unafraid of toil. " into cd fld
"HouseInfo"

end if

if theHouse = "Ravenclaw" then
  set the visible of image "Ravenclaw" to true
  put "You belong in wise old Ravenclaw!  If you've a ready mind!  Where
those of wit and learning,  Will always find their kind. " into cd fld
"HouseInfo"
end if
if theHouse = "Slytherin" then
  set the visible of image "Slytherin" to true
  put "You belong in Slytherin!  You'll make you real friends. Those
cunning folk use any means, To achieve their ends. " into cd fld
"HouseInfo"
end if

end openCard
on closeCard
  global theHouse
  put empty into cd fld "HouseInfo"
  if theHouse = "Slytherin" then
    set the visible of image "Slytherin" to false
  end if
  if theHouse = "Ravenclaw" then
    set the visible of image "Ravenclaw" to false
  end if
  if theHouse = "Hufflepuff" then
    set the visible of image "Hufflepuff" to false
  end if
  if theHouse ="Gryffindor" then
    set the visible of image "Gryffindor" to false
    end if

end closeCard

Okay, now I know I need to get with the program and use case
statements/switch commands.  Still...

No pictures!  I try to set the visible of each to true/false using the
message box "set the visible of image "Gryffindor" to true/false".
Doesn't work.  However, if I instead use "set the visible of image
"gryffindor.gif" to true/false", it works.  Let me try once more just to
ensure that I'm not smoking anything funny...  Okay, it 'shows' a
greyed-out block where the image should be but no image; similarly, it
hides said block.  I double-click this block and check under the "image"
tab and see that it's trying to link to a file in a given (new) directory.
I then check that directory.  The image file is there.  Mind you, I've
also previously imported said file as a control and hidden it with a new
name.

I am getting dizzy chasing my tail...

Okay, I just deleted the link to the external image, and sent openCard to
that card.  Bingo!  Image.  I manually changed theHouse and sent openCard
again.  Grey block for external image.  Delete it.  sent openCard again.
Bingo again.

Was it perhaps becoming confused (certainly as I was) by the two images,
one internal and one external, both named, say, "Gryffindor"?  Because,
certainly each of the images *was* imported, and each of the links to the
external file(s) should have linked to an image that *was* there.  Is this
to be filed under the category of "stupid user error"?

Judy Perry






More information about the use-livecode mailing list