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: FourthWorld, heatherlaine, Klaus, kevinmiller

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9579
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: images din't appear when files transfered

Post by dunbarx » Thu Apr 12, 2018 9:31 pm

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: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: images din't appear when files transfered

Post by bogs » Thu Apr 12, 2018 9:57 pm

Me either, poor girl
:mrgreen: :mrgreen:
Image

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

Re: images din't appear when files transfered

Post by SparkOut » Fri Apr 13, 2018 3:14 am

Why Not Just Use Telephone For Contacting Everyone?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9579
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: images din't appear when files transfered

Post by dunbarx » Fri Apr 13, 2018 3:30 am

Ha.

"Why Not Just Use First Characters EveryWhere"

Craig

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

Re: images din't appear when files transfered

Post by SparkOut » Fri Apr 13, 2018 6:44 am

:lol:
Wow, I was being silly, I never expected the first 4 letters actually to be what I made up!

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

Re: images din't appear when files transfered

Post by bogs » Fri Apr 13, 2018 7:29 am

I think I'll make SparkOut my official translator for first letter speak :twisted:
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: images din't appear when files transfered

Post by richmond62 » Sat Apr 28, 2018 6:44 pm

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: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: images din't appear when files transfered

Post by richmond62 » Sat Apr 28, 2018 6:55 pm

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: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: images din't appear when files transfered

Post by jmburnod » Sun Apr 29, 2018 12:10 pm

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: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: images din't appear when files transfered

Post by richmond62 » Sun Apr 29, 2018 5:09 pm

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: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: images din't appear when files transfered

Post by Klaus » Sun Apr 29, 2018 5:20 pm

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: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: images din't appear when files transfered

Post by richmond62 » Sun Apr 29, 2018 6:05 pm

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: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: images din't appear when files transfered

Post by richmond62 » Sun Apr 29, 2018 7:10 pm

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: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: images din't appear when files transfered

Post by Klaus » Sun Apr 29, 2018 7:23 pm

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: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: images din't appear when files transfered

Post by richmond62 » Sun Apr 29, 2018 7:47 pm

Like David and Jonathan:

"such love . . ."

Thanks, Klaus. 8)
Scots.jpg

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”