images din't appear when files transfered

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10507
Joined: Wed May 06, 2009 2:28 pm

Re: images din't appear when files transfered

Post by dunbarx »

Hah.

i am old, and though I never saw those before, I got them. Of course I have millennial children.

I once texted my daughter:
wnjutfce?
She didn't get it.

Craig
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: images din't appear when files transfered

Post by bogs »

Me either, poor girl
:mrgreen: :mrgreen:
Image
SparkOut
Posts: 2988
Joined: Sun Sep 23, 2007 4:58 pm

Re: images din't appear when files transfered

Post by SparkOut »

Why Not Just Use Telephone For Contacting Everyone?
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10507
Joined: Wed May 06, 2009 2:28 pm

Re: images din't appear when files transfered

Post by dunbarx »

Ha.

"Why Not Just Use First Characters EveryWhere"

Craig
SparkOut
Posts: 2988
Joined: Sun Sep 23, 2007 4:58 pm

Re: images din't appear when files transfered

Post by SparkOut »

:lol:
Wow, I was being silly, I never expected the first 4 letters actually to be what I made up!
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: images din't appear when files transfered

Post by bogs »

I think I'll make SparkOut my official translator for first letter speak :twisted:
Image
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10428
Joined: Fri Feb 19, 2010 10:17 am

Re: images din't appear when files transfered

Post by richmond62 »

What's wrong with this:

Code: Select all

on preOpenStack
   set itemDel to "/"
   set the defaultFolder to item 1 to -2 of (the effective fileName of this stack)
end preOpenStack
'Cos when I have that in a stack it DOES NOT subsequently push all my reffed
image data into image containers in my stack.
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10428
Joined: Fri Feb 19, 2010 10:17 am

Re: images din't appear when files transfered

Post by richmond62 »

When I did this:

Code: Select all

on preOpenStack

put specialFolderPath("resources")&"/myCrap/rez/" into sFolderPath

end preOpenStack
I DID get dull, grey squares, but NOT the pictures I expected.
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2734
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: images din't appear when files transfered

Post by jmburnod »

Hi Richmond
Did you try to set the filename of img to empty before setting the filename of img ?
Best
Jean-Marc
https://alternatic.ch
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10428
Joined: Fri Feb 19, 2010 10:17 am

Re: images din't appear when files transfered

Post by richmond62 »

Thanks Jean-Marc . . .

In my openStack script I have this:

Code: Select all

global route66

on preOpenStack
   put specialFolderPath("resources") & "/Desktop/Obfuscated/May 2018/assets/img/" into route66
   go to card "TITLE"
end preOpenStack
and in the cardScript of the cards where the images reside I have this:

Code: Select all

on preOpenCard
   set the lockScreen to true
   --------
      set the filename of img "p1" to empty
   -------
   set the filename of img "p1" to (route66 & "c1.png")
   set the blendlevel of img "p1" to 0
   --------
   wait 3 ticks
   set the lockScreen to false
end preOpenCard
now, when I open the properties palette of image "p1" I see that the
source is listed as

route66p1.png


and, obviously, the image is rubbish.
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: images din't appear when files transfered

Post by Klaus »

Code: Select all

...
put specialFolderPath("resources") & "/Desktop/Obfuscated/May 2018/assets/img/" into route66
...
Sigh, really? When did you start to use LC, Richmond, a couple of minutes ago? :shock:

In the IDE -> specialFolderPath("resources") points to the folder with the current stack is in!
So if your images are in folder "img" inside that folder, this will do:

Code: Select all

...
set the filename of img "p1" to (specialfolderpath("resources") & "/img/c1.png")
...
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10428
Joined: Fri Feb 19, 2010 10:17 am

Re: images din't appear when files transfered

Post by richmond62 »

When did you start to use LC, Richmond, a couple of minutes ago?
No, as you well know.

BUT, as you also know well, I do not make my living with LiveCode, and like many
other LiveCoders only work in areas of programming that directly impinge on my needs
and interests . . .

I have NEVER, EVER (well, hardly ever) had to work with image data
from outwith the stack I am working with.

So, until very recently, if you had said to me, "What's a relative path?"

I would have told you it was a route through the garden where the paving stones
had been laid by my Uncle. :D
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10428
Joined: Fri Feb 19, 2010 10:17 am

Re: images din't appear when files transfered

Post by richmond62 »

OK: finally I have sorted out the problem.

It seems that IFF I have this in my cardScript:

Code: Select all

global route66
on preOpenCard
put specialFolderPath("resources") & "/assets/img/" into route66

everything works
.

What I would like to know is:

Why does THAT script & the declaration of a global NOT work when it resides in the stackScript?

AND, Klaus: Please cut out the unhelpful remarks, because the
documentation would have one set relative paths and so on in
the stackScript, which, in this case, at least,
disnae wark forbye, an Ahm unco forfechit wi thy breengin.

It helps me, no more than Thee, that LiveCode is written in English:
that language being neither thy nor my calf language.

Allus raxin fae the sense o yin vocable, syne ilka thocht isnae aa that mensefu.
8)
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: images din't appear when files transfered

Post by Klaus »

In LC you need to declare a global variable in every script (not handler) you use it!
That's why this works:

Code: Select all

global route66
on preOpenCard
put specialFolderPath("resources") & "/assets/img/" into route66
...
And a heartfelt "aa that mensefu" to you, too, buddy! :D
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10428
Joined: Fri Feb 19, 2010 10:17 am

Re: images din't appear when files transfered

Post by richmond62 »

Like David and Jonathan:

"such love . . ."

Thanks, Klaus. 8)
Scots.jpg
Post Reply