Try passing in the function name as a string. Like so:

_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;
};


If you don't pass the function name as a string, I think it isn't scoped to
location[movie] as you intend.

Cheers,
Shy
[EMAIL PROTECTED]

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Michael
Hulse
Sent: Sunday, February 26, 2006 5:31 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Start/stop function - not working as AS2.0?


On Feb 26, 2006, at 4:48 PM, jim wrote:
> I havnt tested this but it looks like it should work.


Hi jim! Thanks for you quick response, I really appreciate the help.

Below is my updated code:

_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 the above look right? It is not working for me at the moment...

I wish I were better at AS, I hate to bug all with minor scripting issues...
does anyone have any good links/tutorials for timeline controls?

Many thanks Jim,
Cheers,
Micky

_______________________________________________
[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