Ask a Question related to Macromedia Director Lingo, Design and Development.
-
Yarden Sheffer #1
Global Variable declaration
For some reason this wont compile, it says that i need to declare the
variable before using it
on prepareMovie
global sm204
sm204 = 0
global smx204
smx204 = 0
global sm404
sm404 = 0
global smx403
smx403 = 0
end
__________________________________________________
on mouseUp
if (sm204 = 0) and (smx204 = 0) and (sm404 = 0) and (smx403 = 0) then
repeat with counter = 5 to 50
sprite(7).locV = counter + 212
sprite(8).locV = counter + 234
sprite(9).locV = counter + 256
updateStage
end repeat
sm204 = 1
end if
end
Yarden Sheffer Guest
-
global variable
I have made a site where I need to be able to include a file containing an array of settings in many pages. This array needs to have global scope... -
One line variable declaration with multiple conditions
Howdy list. I'm trying to one lineify this: my $guts = $firstchoice || ''; if(!$guts && $use_second_choice_if_first_is_empty) { $guts =... -
Global variable issues
I have tried controlling sprite behaviors across many small movies. But I have had no luck. So I am now putting all instances of the sprite into the... -
Help Please: 'Warning 5001 global variable "iF_timer" already defined in global scope
Hi there, I have just started to get this error: 'Warning 5001 global variable "iF_timer" already defined in global scope The variable name... -
Abstraction of table variable declaration
Hi all, I'm trying to simplify the maintenance of my stored procedures using SQL Server 2000's table variables. Currently each sp returns... -
David Downie #2
Re: Global Variable declaration
"manno" <manno@xs4all.nl> wrote in message
news:bflas1$36r$1@forums.macromedia.com...Why would you do both?>
> You need to declare the variables in every script where you are using
> in, and preferably at the top of the script _outside_ any handler.
David Downie Guest
-
Andrew Morton #3
Re: Global Variable declaration
> > You need to declare the variables in every script where you are using
You wouldn't. Remove the word "and" and reparse.>> > in, and preferably at the top of the script _outside_ any handler.
> Why would you do both?
Andrew
Andrew Morton Guest
-
manno #4
Re: Global Variable declaration
Ehm, I meant it more like "also; it should be at the top of all those
scripts, not within a handler"
Yes, the "and" was pretty obsolete...
David Downie wrote:
> "manno" <manno@xs4all.nl> wrote in message
> news:bflas1$36r$1@forums.macromedia.com...
>>>>You need to declare the variables in every script where you are using
>>in, and preferably at the top of the script _outside_ any handler.
>
> Why would you do both?
>
>manno Guest
-
David Downie #5
Re: Global Variable declaration
"manno" <manno@xs4all.nl> wrote in message
news:bflgtp$ent$1@forums.macromedia.com...ok. I understand. To date I've declared my globals in each handler, but if>
> Ehm, I meant it more like "also; it should be at the top of all those
> scripts, not within a handler"
> Yes, the "and" was pretty obsolete...
you can just wack the declaration at the top of the script then that might
be cleaner.
David.
David Downie Guest
-
David Downie #6
Re: Global Variable declaration
"manno" <manno@xs4all.nl> wrote in message
news:bflhp0$g9o$1@forums.macromedia.com...Also, less chance of a mistake if you only declare it once.>
> I prefer it at the top because it gives a better overview, saves typing
> if the handlers dealing with alike issues are stored in the same member
> and gives reason to reconsider design if you see the list of globals
> grow and grow.
yep. Sounds as though they would be better local to the handler.> On my just inhereted project i took all the global declarations out of
> the handlers resulting in some scripts having almost 1.5 page of global
> declaration. That amount of globals is much more error prone IMO.
david.
David Downie Guest



Reply With Quote

