View Full Version : calling functions
eptigo
April 14th, 2008, 11:50 PM
having trouble calling functions from different action scripts
the function only seems to work if its residing in the same script of which it is being called
i am uncertain as to how to address this
bluemagica
April 14th, 2008, 11:58 PM
use global functions, as they have scope over the entire swf.
_global.SomeName= function()
{
// your code
}
when calling: _global.SomeName();
eptigo
April 15th, 2008, 12:55 AM
ud think so wouldnt u
actually what i was using was
function case_function() {
//code
}
and insert "case_function()" wherever i want the thing to be. worked fine in my other file
tried using "_global.case_function" but still nothing
only seems to work if case is being called in same script
not sure why it worked there in the other file, and won't work here in this file
and not sure what difference is between
-------------------------------
_global.SomeName= function()
{
// your code
}
--------------------------------
and
-------------------------------
function case_function() {
//code
}
eptigo
April 16th, 2008, 12:36 AM
ok, i got it, what i needed to do is call it by the object its in
so use this:
------------------------------------------
_root.speach_box.nxt_msg.make_talk();
---------------------------------------------
cause the function "make_talk();" is inside the movieclip "nxt_msg" which is inside the movieclip "speach_box".
i needed to specify the location of the function "make_talk();"
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.