Doesn't work: set the top of img "MyImage" of stack pStackName to 0

Mark Stuart mfstuart at cox.net
Sun Sep 12 20:39:09 EDT 2010


Why doesn't the following scripts work?

stack 1 (Name: Test)
on mouseUp
   start using stack "MyLib"
   CreateImage "Test","MyImage"
end mouseUp

stack 2 (Name: MyLib)
command CreateImage pStackName,pName

   --// the image "ImageLib" already exists on the "MyLib" stack.
   --// its properties: Name=ImageLib, Width=150, Height=24, lockLoc=true.
   copy img "ImageLib" of stack "MyLib" to stack pStackName
   set the name of img "ImageLib" of stack pStackName to pName
   
   --// prepare the image to be unlocked before setting the position on
stack 1.
   set the lockLoc of img pName of stack pStackName to false
   
   --// one way to set the position of the image. But this doesn't place it
in the desired position.
   set the rect of img pName of stack pStackName to 0,0,the width of stack
pStackName,24
   
   --// this is another way I tried, but it doesn't work either.
   --set the width of img pName of stack pStackName to the width of stack
pStackName
   --set the left of img pName of stack pStackName to 0
   --set the top of img pName of stack pStackName to 0
      
   set the lockLoc of img pName of stack pStackName to true
end CreateImage

I also used each script in the MessageBox. But that didn't do anything to
the image on stack 1 after running the script.

What am I doing wrong?

Regards,
Mark Stuart
-- 
View this message in context: http://runtime-revolution.278305.n4.nabble.com/Doesn-t-work-set-the-top-of-img-MyImage-of-stack-pStackName-to-0-tp2536789p2536789.html
Sent from the Revolution - User mailing list archive at Nabble.com.



More information about the use-livecode mailing list