Re: Standalone application problem

2007-04-19 Thread Devin Asay


On Apr 18, 2007, at 5:21 PM, Andrew Lian -nswc wrote:


Dear All

Please forgive yet another newbie question.

I have stack which plays a sound file played through a  
playerobject. Its path is identified in the player's Source  
property. Let's say it is C:/sounds/apl.wav.


The file plays perfectly well in the development environment and on  
my computer.


I now make a standalone application - and it is produced ok.  
However, my sound file can no longer be heard. Either it has not  
been automatically packaged into the application or there is a path  
problem.


I have tried to include the relevant file in the package by using  
the Copy Files setting of the Standalone application settings  
but that seems to make no difference. Is there some legible  
documentation somewhere of how to prepare the files so that the  
whole package gets produced correctly with the correct paths? DO I  
have to respect the original paths and recreate them on any  
computer which tries to run the standalone?


Andrew,

Most often it's easiest to leave the external media files in a place  
relative to the defaultFolder. The problem is the default value of  
the defaultFolder changes when running as a standalone vs. in the  
development environment. In the IDE, the defaultFolder is the folder  
containing the Revolution executable. In the standalone environment,  
the stack in essence becomes the executable, so the defaultFolder is  
the folder containing the standalone. If you don't explicitly set the  
defaultFolder to another place on the disk, it will work if you set  
the filename (source) property of the player to 'sounds/apl.wav',  
and then making sure the sounds folder is in the same folder as the  
standalone. To deal with the difference between the IDE and  
standalone, I often include the scripting similar to this in my  
mainstack's stack script:


on preOpenStack
  # set the root folder for all resources
  if the environment is development then
set the defaultFolder to enclosingFolder(the name of me)
  end if

  ## Do this for local data and media files.
  set the baseDir of me to the defaultFolder  /  resources
end preOpenStack

function enclosingFolder pStName
  get the filename of pStName
  set the itemDelimiter to /
  return item 1 to -2 of it
end enclosingFolder

The situation for Mac OS X is slighter more complicated, but easy  
enough to understand, if you're interested.


One last thing... I never use the copy files part of the standalone  
builder. I find it easiest just to build my standalone then move the  
needed files or stacks into the appropriate folder.


HTH

Devin

Devin Asay
Humanities Technology and Research Support Center
Brigham Young University

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Standalone application problem

2007-04-19 Thread J. Landman Gay

Andrew Lian -nswc wrote:

Dear All

Please forgive yet another newbie question.

I have stack which plays a sound file played through a playerobject. Its 
path is identified in the player's Source property. Let's say it is 
C:/sounds/apl.wav.


The file plays perfectly well in the development environment and on my 
computer.


I now make a standalone application - and it is produced ok. However, my 
sound file can no longer be heard. Either it has not been automatically 
packaged into the application or there is a path problem.


I have tried to include the relevant file in the package by using the 
Copy Files setting of the Standalone application settings but that 
seems to make no difference. Is there some legible documentation 
somewhere of how to prepare the files so that the whole package gets 
produced correctly with the correct paths? DO I have to respect the 
original paths and recreate them on any computer which tries to run the 
standalone?


This is almost certainly a file path problem. If you are refering to the 
sound file by a long file path name, it will not be the same on anyone 
else's machine. And if you build a standalone with the file added to the 
standalone folder, then its file path will also have changed.


You can solve the problem in a couple of ways. The easiest way is to 
calculate the correct file path with a script. Something like this 
should work:


put the effective filename of this stack into tPath
set the itemdelimiter to slash
put mySoundFolder/mySoundFile.aif into last item of tPath

This will produce a file path to a file named mySoundFile.aif inside a 
folder called mySoundFolder which is next to the standalone. On 
Windows, that would be a folder in the same parent folder as your 
standalone. On OS X, it would be a folder inside the Mac OS folder which 
is inside the application bundle.


Note that inside the IDE, it won't work until you move a copy of the 
sound file folder into the same parent folder as your stack.


--
Jacqueline Landman Gay | [EMAIL PROTECTED]
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


RE: Standalone application problem

2007-04-19 Thread Dan Soneson

Hi Andrew,

I treat external audio, video and even images much the same way as I  
would
in a web site. When putting together  a standalone that references  
this media
I put the media in a separate folder within the folder that houses  
the standalone
and work with a relative link to the media.  Say your standalone is  
in a folder
called My Standalone. Create a media folder within that folder and  
place your
media in this new folder (or copy your media folder into this new  
standalone
folder). Then you query the path of the standalone, replace the  
standalone name
in the path with the media folder name, and reference your images/ 
audio/video

files using this new path:

put the fileName of this stack into theStackPath
set the itemDelimiter to /
put MyMedia into item -1 of theStackPath

Now you have a reference point for all your media, as long as it is  
housed in the
MyMedia folder. You can retain this in several ways. Perhaps the  
easiest is to

set a custom property of either the stack or the card:

set the uMediaFolder of this stack to theStackPath

Probably the best place to do this is in the preOpenStack handler, on  
the card script
of the first card to open when the stack opens. Don't put it in the  
stack script, or this
script will execute any time a stack opens within your standalone. So  
the preOpenStack

handler on the first card of your stack would look like this:

on preOpenStack
  put the fileName of this stack into theStackPath
  set the itemDelimiter to /
  put MyMedia into item -1 of theStackPath
  set the uMediaFolder of this stack to theStackPath
end preOpenStack

Any time you want to set the filename of a player now, you call up  
the uMediaFolder
of the stack and put the name of the media file after this. Then you  
set the filename

of the player to this path:

put the uMediaFolder of this stack into theFolderPath
put theFolderPath  sound_01.aif into theNewFile
set the filename of player 1 to theNewFile

You can place the above lines into a preOpenCard handler in the card  
script of the
card that contains the player, or you can place it on a mouseUp  
handler to set the new

filename.

This works nicely if you have only one audio file to play. If you  
want to play several, or
want to call up a specific audio file to play, you can use the  
uFolderPath of the stack to
get a list of the files in the media folder, display them as a list  
in a list field. In the script
of the list field you can write a mouseUp handler to set the filename  
of the player to the audio

file that you click on.

In a button or preOpenCard handler you can put a script like this:

on  preOpenCard -- goes in the card script
  put the uMediaFolder of this stack into theFolderPath
  put the defaultFolder into theOrigDefault -- keep track of the  
original default folder
  set the defaultFolder to theFolderPath -- allows us to get a  
listing of all the media files in this folder
  put the files into theMediaFiles -- this gets a list of all files  
in the default folder, one file per line
  -- you may want to do some filtering of this list here, i.e.  
include only files with .wav extension etc.
  filter theMediaFiles with *.wav -- this is optional, if you have  
a mixed type of files
  put theMediaFiles into fld audio files -- this is the scrolling  
list field, you can name it what you want
  set the defaultFolder to theOrigDefault -- restore the original  
default folder

end preOpenCard

Then in your list field script you would have a handler like so:

on mouseUp
  put the selectedText into theFile
  set the filename of player 1 to the uMediaFolder of this stack   
/  theFile

end mouseUp 

The point is, that if you set up a connection to the media folder  
when you first open your stack, either
within the development environment or as a standalone, you can call  
up any individual file pretty

easily.

It was nice to meet you at the ISLS conference in Hawaii, and I'm  
delighted you are checking into

Revolution. Welcome to the Revolution!

Dan
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: standalone application problem

2006-07-08 Thread Michael Robinson

Jacqueline,
I see what you mean, but it did work in the preopenstck handler until  
now, changed it to openstack handler but it still does not work the  
first time.

Any other thoughts
Thanks
Mike





On Jul 7, 2006, at 8:34 PM, J. Landman Gay wrote:


Michael Robinson wrote:

 I will try to give you more information here it is -
 you build the standalone
 start the application
 after it is opened you then either create a new file (cloning of a
 sub-stack) or open a file you already created. Either way when  
the file
 opens, it opens another sub-stack as a drawer. The command  
originates
 from the stack you either cloned or opened in the preOpenstack  
handler.

 The sub-stack that was cloned or opened makes documents.

 So - the whole thing works after you open and close it a few  
times, but

 not from the get-go like it has sense version 1.1.1

When the preOpenStack message is sent, the stack has not been drawn  
on screen yet. So I'm not sure how you could open a drawer on a  
stack that isn't there. Since you say it used to work, maybe the  
stack was forced into visibility prematurely (which is just a wild  
guess.) At any rate, what happens if you move the drawer command to  
the openStack handler instead? The openStack handler is sent after  
the stack is already open and the window has been created. You need  
a visible window to hang a drawer from.


I may still be confused about the order of the actions you're  
executing, so maybe this won't work, but it is worth a try.


--
Jacqueline Landman Gay | [EMAIL PROTECTED]
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: standalone application problem

2006-07-08 Thread J. Landman Gay

Michael Robinson wrote:
 I see what you mean, but it did work in the preopenstck handler until
 now, changed it to openstack handler but it still does not work the
 first time.
 Any other thoughts

Not really, since it is hard to debug a problem that isn't in front of 
me. I think you will have to debug it yourself. Try setting a breakpoint 
in the preOpenStack handler and then stepping through the scripts in the 
debugger one line at a time. Watch the values in the variable watcher as 
you go. Also, put get the result after every line of script that 
accesses a file or opens a stack. When you step through in the debugger, 
the it variable will show you if there are any errors returned in the 
result. If the stacks aren't being found, for example, the result will 
be no such stack. That may give you a clue what is failing. It may be 
something as simple as incorrect or incomplete file paths.


Once you see what's wrong, you can remove all the result lines.

--
Jacqueline Landman Gay | [EMAIL PROTECTED]
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: standalone application problem

2006-07-07 Thread Sarah Reichelt

On 7/7/06, Michael Robinson [EMAIL PROTECTED] wrote:

I am having a problem with Revolution 2.7.2 that I never had with
previous versions!
After building a standalone application and opening it, the main
stack seems to  works OK, it is when you create a new file ( cloning
of a sub-stack ) the new file is created but does not work just
right, almost like it does not know who it is or where is located.

1) It will not open a drawer that is in a preopenstack handler until
it is closed and reopened 1 time, but it will open the drawer from
the menu the first time.

2) It will create a new document when the file is created, but will
not import information from another file until it is opened  closed
2 times.


Hi Mike,

I noticed you ask this a few days ago, but as I had no answers to
give, I didn't respond. As you are now tearing your hair out, I'll
suggest a few things to check.

When you clone your sub-stack, does it appear OK?
When you save it, does the save work? (check 'the result' after a save.)
After saving, check the filename of your new stack.
Is it saving in the default folder or are you specifying the complete path?
When you try to open it again, do you specify the complete path?
Remember that when you clone a stack, it is a mainStack and does not
inherit the scripts from your original mainStack. You can allow for
this, either by setting it's mainStack, or by start using your
original mainStack so it is available to all stacks, whether they are
it's own sub-stacks or not.
Is the preOpenStack message passed when you clone a stack? Maybe you
need to send it a few ticks after the cloning.
After cloning, try delaying subsequent things using send in time and
see if that helps.

As you can see, I don't really have any great ideas, but these
thoughts may get you started towards a diagnosis.

Cheers,
Sarah
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: standalone application problem

2006-07-07 Thread J. Landman Gay

Michael Robinson wrote:

After building a standalone application and opening it, the main stack 
seems to  works OK, it is when you create a new file ( cloning of a 
sub-stack ) the new file is created but does not work just right, almost 
like it does not know who it is or where is located.


Well, a new cloned stack doesn't have a file name on disk yet so 
probably it really doesn't know who it is. But most things you can do in 
a script don't require a stack to have a file name, so usually that 
doesn't matter. Not always though.




1) It will not open a drawer that is in a preopenstack handler until it 
is closed and reopened 1 time, but it will open the drawer from the menu 
the first time.


I think we need more information. Do you mean you are trying to open a 
stack as a drawer before the main stack is drawn yet? I'd be surprised 
if that could be done, but I never thought to try it.  Which stack opens 
a drawer, and where does the command originate? Which stack has the 
preOpenStack handler in it?




2) It will create a new document when the file is created, but will not 
import information from another file until it is opened  closed 2 times.


I don't think I understand this either. What is the new document you're 
making (a text file? A stack?) What file is created? You should be able 
to import images or text into a stack that hasn't been saved to disk yet.


Can you describe the series of actions you want in more detail?



This is driving me crazy!


We'll try to find you some Thorazine if all else fails. ;)

--
Jacqueline Landman Gay | [EMAIL PROTECTED]
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: standalone application problem

2006-07-07 Thread Michael Robinson

Sarah,

1.  yes after sub-stack is cloned it appears OK
2.  the cloned stack saves work
3.  checking the filename after it is cloned returns empty
4.  I  am  saving the cloned stack to the default folder
5.  when I reopen the cloned stack I am using ask file
6. Yes the preOpenstack is passed

I am trying the ticks  and yes you did get me to think in another  
direction.


Thanks for the help - Mike




On Jul 6, 2006, at 11:47 PM, Sarah Reichelt wrote:


On 7/7/06, Michael Robinson [EMAIL PROTECTED] wrote:

I am having a problem with Revolution 2.7.2 that I never had with
previous versions!
After building a standalone application and opening it, the main
stack seems to  works OK, it is when you create a new file ( cloning
of a sub-stack ) the new file is created but does not work just
right, almost like it does not know who it is or where is located.

1) It will not open a drawer that is in a preopenstack handler until
it is closed and reopened 1 time, but it will open the drawer from
the menu the first time.

2) It will create a new document when the file is created, but will
not import information from another file until it is opened  closed
2 times.


Hi Mike,

I noticed you ask this a few days ago, but as I had no answers to
give, I didn't respond. As you are now tearing your hair out, I'll
suggest a few things to check.

When you clone your sub-stack, does it appear OK?
When you save it, does the save work? (check 'the result' after a  
save.)

After saving, check the filename of your new stack.
Is it saving in the default folder or are you specifying the  
complete path?

When you try to open it again, do you specify the complete path?
Remember that when you clone a stack, it is a mainStack and does not
inherit the scripts from your original mainStack. You can allow for
this, either by setting it's mainStack, or by start using your
original mainStack so it is available to all stacks, whether they are
it's own sub-stacks or not.
Is the preOpenStack message passed when you clone a stack? Maybe you
need to send it a few ticks after the cloning.
After cloning, try delaying subsequent things using send in time and
see if that helps.

As you can see, I don't really have any great ideas, but these
thoughts may get you started towards a diagnosis.

Cheers,
Sarah
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: standalone application problem

2006-07-07 Thread Michael Robinson

Jacqueline,

I will try to give you more information here it is -
you build the standalone
start the application
after it is opened you then either create a new file (cloning of a  
sub-stack) or open a file you already created. Either way when the  
file opens, it opens another sub-stack as a drawer. The command  
originates from the stack you either cloned or opened in the  
preOpenstack handler. The sub-stack that was cloned or opened makes  
documents.


So - the whole thing works after you open and close it a few times,  
but not from the get-go like it has sense version 1.1.1 This  
application make mix design for concrete, and is being upgraded about  
every 4 months. But this problem for some reason I just do not get,  
hope it is simple and will be resolved soon


Thanks for any help

Mike







On Jul 7, 2006, at 5:58 PM, J. Landman Gay wrote:


Michael Robinson wrote:

After building a standalone application and opening it, the main  
stack seems to  works OK, it is when you create a new file  
( cloning of a sub-stack ) the new file is created but does not  
work just right, almost like it does not know who it is or where  
is located.


Well, a new cloned stack doesn't have a file name on disk yet so  
probably it really doesn't know who it is. But most things you can  
do in a script don't require a stack to have a file name, so  
usually that doesn't matter. Not always though.


1) It will not open a drawer that is in a preopenstack handler  
until it is closed and reopened 1 time, but it will open the  
drawer from the menu the first time.


I think we need more information. Do you mean you are trying to  
open a stack as a drawer before the main stack is drawn yet? I'd be  
surprised if that could be done, but I never thought to try it.   
Which stack opens a drawer, and where does the command originate?  
Which stack has the preOpenStack handler in it?


2) It will create a new document when the file is created, but  
will not import information from another file until it is opened   
closed 2 times.


I don't think I understand this either. What is the new document  
you're making (a text file? A stack?) What file is created? You  
should be able to import images or text into a stack that hasn't  
been saved to disk yet.


Can you describe the series of actions you want in more detail?


This is driving me crazy!


We'll try to find you some Thorazine if all else fails. ;)

--
Jacqueline Landman Gay | [EMAIL PROTECTED]
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: standalone application problem

2006-07-07 Thread J. Landman Gay

Michael Robinson wrote:

 I will try to give you more information here it is -
 you build the standalone
 start the application
 after it is opened you then either create a new file (cloning of a
 sub-stack) or open a file you already created. Either way when the file
 opens, it opens another sub-stack as a drawer. The command originates
 from the stack you either cloned or opened in the preOpenstack handler.
 The sub-stack that was cloned or opened makes documents.

 So - the whole thing works after you open and close it a few times, but
 not from the get-go like it has sense version 1.1.1

When the preOpenStack message is sent, the stack has not been drawn on 
screen yet. So I'm not sure how you could open a drawer on a stack that 
isn't there. Since you say it used to work, maybe the stack was forced 
into visibility prematurely (which is just a wild guess.) At any rate, 
what happens if you move the drawer command to the openStack handler 
instead? The openStack handler is sent after the stack is already open 
and the window has been created. You need a visible window to hang a 
drawer from.


I may still be confused about the order of the actions you're executing, 
so maybe this won't work, but it is worth a try.


--
Jacqueline Landman Gay | [EMAIL PROTECTED]
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution