Cloned Stacks

Moderators: LCNeil, heatherlaine, kevinmiller, elanorb

marcelloe
Posts: 140
Joined: Thu Oct 17, 2013 2:26 pm

Cloned Stacks

Post by marcelloe » Wed Feb 19, 2014 9:49 pm

I have cloned stacks and I want to take that cloned stack and show a preview on the main stack in a scrolling field. Is this even possible?

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Cloned Stacks

Post by LCNeil » Thu Feb 20, 2014 12:17 pm

Hi Mark,

You would have take a snapshot of one of the card of a stack in order to achieve and then place the generated images within a scrolling group to generate this effect.

An example script to take such a snap shot would be-
import snapshot from rect (the rect of this stack)
set the width of the last image to "200"
set the height of the last image to "150"
set the loc of the last image to the loc of this card
You should be able to name any open stack and set the size and position to anything you want. You can then use the group command to group any snap shots.

Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
-

marcelloe
Posts: 140
Joined: Thu Oct 17, 2013 2:26 pm

Re: Cloned Stacks

Post by marcelloe » Thu Feb 20, 2014 4:16 pm

How do I capture a snap shot the card? When the snap shot is in the scrolling field when touch will bring up the original stack to edit. My problem is I know what I want to do, but not sure what i can and can't do.

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Cloned Stacks

Post by LCNeil » Thu Feb 20, 2014 5:02 pm

Hi Mark,

How many cards do you have in your stack and what are their names? As you should be able to snapshot a specific card.

I would not recommend a scrolling field but a scrolling group as mentioned above. The imported snapshots can then have scripts applied to them (e.g. mouseUp) which will respond to any script that you want to exectute

e.g.
on mouseUp
go to card "page1"
end mouseUp
Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
-

marcelloe
Posts: 140
Joined: Thu Oct 17, 2013 2:26 pm

Re: Cloned Stacks

Post by marcelloe » Thu Mar 06, 2014 7:59 pm

In the sub-stack that I want to clone and then put a snapshot of one card, but has two sections. I want each section of the card to be display as a snapshot side by side. The name of the card is MOQ.

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Cloned Stacks

Post by LCNeil » Mon Mar 10, 2014 10:57 am

Hi Mark,

If possible, could you supply the scripts you have attempted to implement so far and I should be able to advise further.

Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——

marcelloe
Posts: 140
Joined: Thu Oct 17, 2013 2:26 pm

Re: Cloned Stacks

Post by marcelloe » Mon Mar 10, 2014 2:08 pm

This is my thinking but I am sure this is not correct. What I really want to happen is snapshots of a card from a sub-stack to be like a preview on the main stack. There are going to be several of these previews and I want to make them scrolling. Not sure but do I need to create new place holders each time? not sure what is the best method.

Code: Select all

on mouseUp
   put image "image1" into graphic "graphic1" card "card1"
   put field "field1" into field "field1" card "card1"
   put field "field2" into field "field2" card "card2"
end mouseUp

marcelloe
Posts: 140
Joined: Thu Oct 17, 2013 2:26 pm

Re: Cloned Stacks

Post by marcelloe » Mon Mar 10, 2014 3:41 pm

Stupid question. I know you can add other stack to your project, but my add stack is grayed out. How do i add stacks?

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Cloned Stacks

Post by LCNeil » Mon Mar 10, 2014 4:50 pm

Hi Mark,

As mentioned above, you will have to import a snapshot of the card you wish to use as a thumbnail e.g.

Code: Select all

  import snapshot from rect (the rect of card 1) of card 1
then if you want to add this image to an existing image control, you should use something like the following script immediately after importing the snapshot-

Code: Select all

   hide the last image
   set the text of image "imageTest" to the text of the last image
You can either lock the location of your image control which means it will be a set size or set it via script like you have been trying.

One you have the image thumbnails, you should be able to create a scrolling group with them contained which will give you the desired scrolling effect.

In regards to your substack being grayed out, I am not sure on the behaviour you are explaining. If possible could you supply a screenshot or sample stack showing this.

Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Cloned Stacks

Post by LCNeil » Wed Mar 12, 2014 2:12 pm

Hi Mark,

Thank you for supplying your screenshot. I now understand the substack section being greyed out. This behaviour is present because it is not possible use this with iOS. You should use the copy files section instead.

The following is taken from the iOS release not regarding this-
Note: The Inclusions, Copy Referenced Files, Bug Reports and Stacks features are not available
when building for iOS. If you wish to include multiple stackfiles in your application, use the Copy
Files feature instead.
http://downloads.livecode.com/livecode/ ... 5-iOS.pdf

Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——

marcelloe
Posts: 140
Joined: Thu Oct 17, 2013 2:26 pm

Re: Cloned Stacks

Post by marcelloe » Wed Mar 12, 2014 8:14 pm

I have added a stack to the copy files area. Now how do I call that stack? This is what i have tried to use, but it doesn't work.

Code: Select all

on mouseUp
go to card "card1" on stack "stack1"
end mouseUp

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Cloned Stacks

Post by LCNeil » Thu Mar 13, 2014 12:40 pm

Hi Mark,

You have to first open your stack as LiveCode does not know that it exists. As you have used "copy files" then this places the stack in the engine directory. You can use specialFolderPath to access this and then use "Open Stack" to open the stack file.

Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
——

marcelloe
Posts: 140
Joined: Thu Oct 17, 2013 2:26 pm

Re: Cloned Stacks

Post by marcelloe » Thu Mar 13, 2014 6:51 pm

I am trying to call a main stack that has been copied to the IOS files. Not sure what I am doing wrong.

Code: Select all

on mouseUp
start using stack specialFolderPath("documents") &" /photo.livecode"
end mouseUp

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Cloned Stacks

Post by LCNeil » Fri Mar 14, 2014 9:15 am

Hi Mark,

What script did you use to copy the stack from the engine folder to the documents folder?

Kind Regards,


Neil Roger
--
RunRev Support Team ~ http://www.runrev.com

marcelloe
Posts: 140
Joined: Thu Oct 17, 2013 2:26 pm

Re: Cloned Stacks

Post by marcelloe » Fri Mar 14, 2014 1:55 pm

I tried it with the Engine Folder, but it would not work either. Do I need to move it from the Engine folder to the Documents Folder?

Post Reply

Return to “idea2app and Coding School”