Page 1 of 1

Resize Images sent to Substack

Posted: Sun May 25, 2014 6:58 pm
by William Jamieson
Hello. I got a fairly basic question regarding the resizing of images as done per the intro to Livecode tutorial when making the task list. Here is what I did.

I made a substack named "resources"
Made a card "images"

on the preopenstack handler of the main stack i have the line

send "resizeImages" to card "images" of stack "resources"

on the card script I have the following code

Code: Select all

on resizeImages
   put the height of stack "Med Engagement" into tHeight
   put the width of stack "Med Engagement" into tWidth
   set the height of image "arrowSmall" of me to 0.09 * tHeight
   set the width of image "arrowSmall" of me to 0.16* tWidth
   set the height of image "Splash Screen 1.jpg" of me to tHeight
   set the width of image "Splash Screen 1.jpg" of me to tWidth
   
      set the width of img "searchButton.png" of me to 0.18 * tWidth
   set the height of img "searchButton.png" of me to 0.09 * tHeight
   set the width of img "myMeds.png" of me to 0.16 * tWidth
   set the height of img "myMeds.png" of me to 0.08 * tHeight
   set the width of img "menuButton.png" of me to 0.16 * tWidth
   set the height of img "menuButton.png" of me to 0.07 * tHeight
   set the width of img "docButton.png" of me to 0.17 * tWidth
   set the height of img "docButton.png" of me to 0.07 * tHeight
   set the width of img "backButton.png" of me to 0.17 * tWidth
   set the height of img "backButton.png" of me to 0.08 * tHeight

   
end resizeImages
Now this code works fine and the images will resize. It works for only one card however. As soon as I change the card on the main stack such as [go to card "menu" of this stack] all the images in stack "resources" return to their original size. There are no other handlers that resize images.

What can I do to keep the images resized rather than having to execute the "resizeImages" handler on every card?

Re: Resize Images sent to Substack

Posted: Sun May 25, 2014 7:01 pm
by Klaus
Hi William,

set the "lockloc" of the image(s) to true!


Best

Klaus

Re: Resize Images sent to Substack

Posted: Mon May 26, 2014 6:36 pm
by William Jamieson
Hi Klaus!

Thank you for helping me out. have been livecoding for about a year now and I have never in any of my projects needed to lock the images. Yes, you are right, I almost forgot about that property. You saved the day once again Klaus. But it seems as though something is critically different with the new version of Livecode. I dont know if this is a work around to a problem, or if I just got lucky that it worked in the past.... hmmm...

Thank you once again, that should work. Ill test it out and if I dont post back, consider it solved.

-Will