| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Aug 2004
Posts: 25
|
Ok, you know how theres _global to call variables gobally i'd like to know how to create a global function which all my objects will run off. I have no idea how I'll go about doing this so if you can give me a template to run off it will really make my day.
Thanks & Seasons Greetings! |
|
|
|
|
|
#2 |
|
Well known nobody
Join Date: Jul 2004
Location: Australia
Posts: 818
|
I haven't tried it myself, but you might want to try something like _global.myFunction = function() {...} or function _global.myFunction {...}
|
|
|
|
|
|
|
|
|
#3 |
|
Registered User
|
or you can do, _root.myFunction()
if its on the root path for instance ![]() |
|
|
|
|
|
#4 |
|
Allez les Bleus!!!
Join Date: Oct 2002
Location: Paname
Posts: 2,495
|
_global.yourFunction = function () {} ;
should do the trick, but you could also add that function to the methods of your class. If you're handling mcs, you could go: MovieClip.prototype.yourFunction = function () {} ; and then call yourMc.yourFunction () ; |
|
|
|
|
|
#5 |
|
ActionScript Oracle
|
pom is right _global.yourFunction = function () {} . i perfer to use this method instead of _root.yourFunction = function () {} because if you are loading movies into levels the _root will not be consistant.
just my 2 cents. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|