You are passing the return of the function  not the function itself. Whe
n passing use:

_root.stopButton.onRelease = function() { startStopMovies(_root, 
stop); };

You see after the stop there are no brackets, this means you are passing
a reference to the function not the result of the function.

Then in your actual function use:

location[movie][control]();

I havnt tested this but it looks like it should work.

Jim

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Michael
Hulse
Sent: 27 February 2006 00:37
To: Flashcoders mailing list
Subject: [Flashcoders] Start/stop function - not working as AS2.0?

Hi,

Is it ok for me to pass a built-in function as argument of another 
function (see example below)?

For some reason, the below code does not stop nested movie-clips... It 
was working when things were not AS2.0...

/* Attach function to stop button: */
_root.stopButton.onRelease = function() { startStopMovies(_root, 
stop()); };
/* Attach function to start button: */
_root.startButton.onRelease = function() { startStopMovies(_root, 
play()); };

// Functions:
//
startStopMovies = function(location, control) {
        for(var movie in location) {
                if (typeof(location[movie]) == "movieclip") {
                        location[movie].control;
                        stopMovies(location[movie]);
                }
        }
        //_root.control;
};

Does anyone have suggestions for stopping all movie-clips everywhere? 
The only examples I could find on the web were old.

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to