|
Author |
Topic: knowing if authoring/local/online (Read 639 times) |
|
pollux
|
knowing if authoring/local/online
« on: Apr 29th, 2003, 7:48pm » |
|
right now (and most of my time) i'm working with some online apps that have to grab code from a php file, to respond to some javascript commands, etc. so i have to hardcode everuthing to work while in authoring mode. usually i have that under a boolean called authoring (quering directly the server instead of the php, a fixed value for getCodeBase() command, images locally...) usually as well, i forget to reset the authoring var... well, i'll learn. but i was wondering if there's a way for the applet to know if it is online, local, or in authoring mode. Director has "the environment" which gives you all the info you need on those cases (even if the computer is connected or not). can i simulate something similar? is there a way for the applet to know where it stands? and if not, could there be a built-in variable that goes "false" when the applet gets exported to web?
|
pollux | www.frwrd.net
|
|
|
fry
|
Re: knowing if authoring/local/online
« Reply #1 on: May 1st, 2003, 5:05am » |
|
i'm moving this to the suggestions area, as i think it may be useful to have in there in a general way. currently you can probably hack it--i.e. getCodeBase() will return null or barf. you might be able to test whether g.applet is null, but that may go away in the future, and i haven't looked at it recently to see how consistent that is.
|
|
|
|
fry
|
Re: knowing if authoring/local/online
« Reply #2 on: Sep 20th, 2003, 2:04am » |
|
implemented for 0060. the function is called online() and returns true if the applet is online.
|
|
|
|
|