Page 1 of 1

still trouble with standalone

Posted: Sat May 21, 2016 9:39 pm
by mister
i've tried to save data as an IOS standalone following these lessons verbatim and with different lines of code. The problem is that only the splash screen shows. i don't see the other stack in contents package or when i launch the stack. i am including it in the stack files of the stand alone.

For my splash screen, i use a stack with a colored rectangle on the card. I've tried the following many many times. The first throws an error before you even save as a standalone.

i've tried this with lc 8.0.0 and 8,0.0 rc1.

Code: Select all

on preOpenStack
   if the environment is "mobile" then
      set the loc of this stack to the screenLoc
      put the document folder into thedocPath
      --put the engine folder into the docPath
      --put  specialFolderPath("engine") into theDocPath
      put "/number.livecode" after theDocPath
   end if
  
   if there is not a file theDocPath then
      put the effective fileName of this stack into theMoveFromPath
      set the itemDel to slash
      put "number.livecode" into the last item of theMoveFromPath
      rename file theMoveFromPath to theDocPath
   end if
    --answer theDocPath
   go invisible stack theDocPath
   end preOpenStack
   
  on OpenStack
   wait 3 seconds
   show stack "number"
   close stack "sp"
end OpenStack
i never got this to work either, using i believe 7.1.2 and 7.1.3

Code: Select all

on openStack
    open stack "Main Application.livecode"
    close stack "Launcher"
end openStack

on mouseUp
   set the cName of this stack to fld "name"
   put empty into fld "name"
end mouseUp

on closeStack
    save this stack
    pass closeStack
end closeStack
What simple thing am i missing again, thanks

Larry

Re: still trouble with standalone

Posted: Sat May 21, 2016 10:16 pm
by Simon
Hi Larry,
put the document folder into thedocPath
should be

Code: Select all

put specialFolderPath("resources") into thedocPath
That will solve the first error.

Simon

Re: still trouble with standalone

Posted: Sun May 22, 2016 8:19 pm
by jacque
Actually, I think the docPath is okay but this is the part that errors:

Code: Select all

put the effective fileName of this stack into theMoveFromPath
set the itemDel to slash
put "number.livecode" into the last item of theMoveFromPath
The source path for the file that needs to be copied is in the "resources" folder, so this should work:

Code: Select all

put specialFolderPath("resources") & "number.livecode" into  theMoveFromPath
That should find the original file. One reason you may be getting an error in the IDE is because you've only defined theDocPath inside the check for mobile. In the IDE, the docPath will not have a value. Move theDocPath assignment outside the mobile environment "if" block.

Re: still trouble with standalone

Posted: Sun May 22, 2016 9:05 pm
by Klaus
Hi mister,

what Jaques and Simon say! :D

BUT: Do not use RENAME, we are not allowed to modify, and renaming IS some kind of modifying, in the engine folder!
Delete that line and COPY the stack fiel to the documents folder like this:

Code: Select all

...
put specialFolderPath("documents") & "/number.livecode" into theDocPath
put specialFolderPath("resources") & "/number.livecode" into theMoveFromPath

## Now copy the file:
put url("binfile:" & theMoveFromPath) into url("binfile:" & theDocPath)
...
Best

Klaus

Re: still trouble with standalone

Posted: Mon May 23, 2016 9:04 pm
by mister
Thanks all of you. That worked for the IDE but does not work on my phone. It's not copying the file into the bundle. i don't if it's the script or what. i've tried a lot of different variations with the script. One thing i notice though when I add the stack file, it shows just one in the bottom right box and then after i set do the IOS setting there is still only one in the stacks file but has been switched to the splash screen. The pictures are in reverse order.
Screen Shot 2016-05-23 at 2.19.12 PM.png

I'm using OS X 10.11; IOS 9.3; lc 8.0 rc-1;


Thanks again, Larry

Re: still trouble with standalone

Posted: Tue May 24, 2016 2:21 pm
by mister
What a moroon. it's copy files, not add stacks with IOS. :oops:

Thanks again,

larry