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

Chipp Walters chipp at chipp.com
Tue Sep 14 17:03:10 EDT 2010


Does it throw an error at anytime? Is there a stack "Test" ? Have you run it
through the debugger?
Assuming all the objects exist, here are a couple things I might try.

try:
set the name of last image of stack pStackName to pName
instead of
set the name of img "ImageLib" of stack pStackName to pName

some other things you might look at..
setting the defaultstack to pStackName
getting the width of the card, not the stack.

btw, you don't need to set the lockloc to true to move an image around via
script control.


On Sun, Sep 12, 2010 at 7:39 PM, Mark Stuart <mfstuart at cox.net> wrote:

>
> 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.
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



-- 
Chipp Walters
CEO, Shafer Walters Group, Inc.



More information about the Use-livecode mailing list