Page 1 of 2

Switching between subStacks

Posted: Fri Feb 14, 2014 5:43 am
by KennyR
I am having a strange behavior when moving between sub stacks. When I navigate to a sub stack from my main stack, or for that matter even between sub stacks, my visual effects no longer work. The very first time I click a button and navigate to a sub stack, the visual effects work fine...(i.e. push left very fast) But when I return to the main stack and click the same button, the effect does not work and it just opens the stack with no push. I hope this is not too difficult to understand...any thoughts?

p.s. this is how my button is coded ...just fyi

on mouseUp
visual effect push left very fast
go stack "someStack"
end mouseUp

Re: Switching between subStacks

Posted: Fri Feb 14, 2014 12:46 pm
by Klaus
Hi Kenny,

you MUST use the new syntax for visual effects!
Otherwise LC might even crash on mobile!

The trick to make a visual effect work between STACKS (which is not supported otherwise!)
is to use the SAME window! This requires that both stack have the SAME dimension in W/H!

Code: Select all

on mouseUp
  ## New syntax, part I:
  lock screen for visual effect

  ## The TRICK:
  go stack "someStack" in window of this stack

  ## New syntax, part II:
  unlock screen with visual effect push left very fast
end mouseUp
Best

Klaus

Re: Switching between subStacks

Posted: Fri Feb 14, 2014 1:17 pm
by KennyR
Klaus....I have attempted to make the necessary changes you suggested but now my buttons do not work at all....and now it even crashes in the simulator....I checked and made sure that both the main stack and sub stack I am trying to navigate to are the same dimensions, and they are....I changed the coding on both navigation buttons to reflect the changes you suggested but no joy....by the way....thank you for letting me know about the changes because I never would have figured that out....guess things changed when I stepped away from LC during the openSource hiatus...any further suggestions would be greatly appreciated....I'll attach the code for my button to show you what I am doing...

Code: Select all

on mouseUp
lock screen for visual effect
go stack "tracking" in window of this stack
unlock screen with visual effect push left very fast
end mouseUp

Re: Switching between subStacks

Posted: Fri Feb 14, 2014 1:45 pm
by KennyR
Okay update....Instead of using the simulator I decided to navigate in the UI to see if LC would pop up an error msg and it did....

"A stack "tracking" is already in memory.
The Revolution UI does not distinguish stacks
which have identical names, so editing these
stack files while both are in memory could
result in data loss."

I'm confused...

Re: Switching between subStacks

Posted: Fri Feb 14, 2014 1:48 pm
by Klaus
Hi Kenny,

hm, just tested, and yes, it does not work, althought it should!?
In my test it goes to the other stack with a visual effect, but then goes back to the "calling" stack and hangs :(

Looks like a bug to me, will ask on the mailing list and maybe bug report it.

Sorry, I don't have a workaround for this in the moment.


Best

Klaus

Re: Switching between subStacks

Posted: Fri Feb 14, 2014 1:50 pm
by Klaus
Crossposting :D

I did not see any error like yours!?

Re: Switching between subStacks

Posted: Fri Feb 14, 2014 1:55 pm
by KennyR
Klaus....I was wondering if something was up with LC...I have been having some weird issues with my program....things that are not working as expected or only working occasionally....I went as far as to reinstall LC last night thinking that would solve the problem.....a couple of things that come to mind right away are this....

1) 7.0 simulator hangs on launch and only works after about the 3rd time attempting to open it
2) saving the standalone does not always result in a file or folder being placed on my hard drive. (this is strange because I can see the folder in the finder but not from the open file path of the LC IDE.
3) visual effects are spotty....meaning they only work some of the time.

I can't think of anything else off the top of my head but I'll report anything I think of after I have had my 3rd cup of coffee....

Thanks Klaus....Keep me posted if you think of any work around....

Re: Switching between subStacks

Posted: Fri Feb 14, 2014 1:57 pm
by KennyR
Klaus wrote:Crossposting :D

I did not see any error like yours!?
you mean the memory error?

Re: Switching between subStacks

Posted: Fri Feb 14, 2014 2:02 pm
by Klaus
Yes, and I have no idea why it pops up in your case!?

Is "tracking" a substack of the stack where you click the button to go to the substack?
Then it IS already in memory and should not give any error?

In any way it looks like you are trying to load stack "tracking" a second time although it is already in memory!?

Re: Switching between subStacks

Posted: Fri Feb 14, 2014 2:09 pm
by KennyR
Yes it is a sub stack that I am trying to nav to...the button is on the main stack that performs the effect...

Re: Switching between subStacks

Posted: Fri Feb 14, 2014 2:14 pm
by Klaus
Hm, almost identical setup as my test.
I will wait for an answer on the mailing list and will bug report this if neccessary.

Maybe we are overseeing something extremely obivous? 8)
I highly doubt :D

Re: Switching between subStacks

Posted: Fri Feb 14, 2014 3:24 pm
by KennyR
Did some more testing and something interesting is happening....I decided to use the ID of the stack instead of the name when telling the button to navigate. What happens is the visual effect works but it takes you right back to the card you were on instead of displaying the card you called. It is almost as if the main stack and the sub stack are thinking they are the same stack....

UPDATE: So I got curious and set up a new test stack and sub stack just to see if something in my program was mucking up things and found that the same problem happens in the new program....Part of me is happy it is not something in my original program messing things up, but another part of me is upset that this error is happening in a completely new stack....How can I be the only one having this issue? Something as simple as a visual effect when navigating to a new card should have been picked up by others making IOS apps. Maybe it is something strictly on my side? I did another uninstall and reinstall of LC but no luck....I'm out of ideas...

Re: Switching between subStacks

Posted: Sat Feb 15, 2014 3:42 pm
by KennyR
I just wanted to see if someone would try this sample stack out and see if the bug reproduces in other simulators....I reported the bug and used this sample stack....thanks
effects2.livecode.zip
(2.38 KiB) Downloaded 292 times

Re: Switching between subStacks

Posted: Sat Feb 15, 2014 4:45 pm
by Klaus
Hi Kenny,

unfortunately no reaction from the mailing list so far.
Did you already bug report this? If yes, what bug number?

BTW, it does not even work without a visual effect!


Best

Klaus

Re: Switching between subStacks

Posted: Sat Feb 15, 2014 5:00 pm
by KennyR
Oops, sorry I accidentally clicked "edit" and not "quote" and so overwrote your origina posting :shock:
It was bug number 11813 and you wanted to kee me infomed...