Re: a Flash methods question?



On Mon, 21 Sep 2009 11:13:38 +0200, Thomas 'PointedEars' Lahn
<PointedEars@xxxxxx> wrote:

Dr J R Stockton wrote/:
Thomas 'PointedEars' Lahn posted:
Geoff Cox wrote:
I know that JavaScript can use Flash methods to start/stop etc a swf
file being played using code such as

function startMovie() {
movieplayed = true;
var flash = window.movie || document.movie;
flash.Play();
}
What a junk. You could have at least considered to declare `movieplayed'.

One does not declare, within a function, any global variables that it
uses.

True, and I did not imply otherwise.

Since the result of that assignment is never used within the
function, it must be global.

Non sequitur. Because it is not declared locally, it must be defined in one
of the outer execution contexts (not necessarily the global one); in one of
those it should be declared or one risks attempting to augment a host object
in the scope chain, the side effects ranging from overwriting a special
property to a runtime error (as demonstrated before for the MSHTML DOM).

Thomas,

I did declare it as a global variable and no doubt should have said
so.

Cheers

Geoff




PointedEars
.



Relevant Pages

  • Re: a Flash methods question?
    ... function startMovie() { ... You could have at least considered to declare `movieplayed'. ... One does not declare, within a function, any global variables that it ...
    (comp.lang.javascript)
  • Re: confused about global namespace and scope
    ... If you want a separate header for your global variables, ... I avoid too many global variables in a C++ app. ... are comparing a UNIX project that you write from scratch with a Windows ... >> You can declare it in any source file. ...
    (microsoft.public.vc.mfc)
  • RE: Static and Global Variables
    ... the top of a standard module using Dim instead of Public is visible only ... the major problem with Global variables is that any unhandled error ... a better technique is to use a Static function. ... I often declare public variables in a standard module. ...
    (microsoft.public.access.modulesdaovba)
  • Re: global variables - shared subroutines
    ... I followed your steps -I haven't thought about the public declaration of the ... > Declare the global variable in only one place. ... >> my application and there are some subroutines which are common and I was ... >> value of the global variables do not change. ...
    (microsoft.public.word.vba.general)
  • Calendar Object
    ... calendar form, after it pops up. ... >Works better as a string, ... it won't allow me to declare the global ... >>that matter) as it state that global variables cannot be ...
    (microsoft.public.access.reports)

Loading