AS question
- Started
- Last post
- 5 Responses
- Fariska
I have on the timeline this command:
my_mc.onRollover = myfunctionand i have defined the function in this way:
function myfunction(){
statements
}now, this works correctly, but i need to pass a parameter to my function, so i wrote this:
my_mc.onRollOver = myfunction(value)and the function:
function myfunction(param){
something.gotoAndStop(param)
}but now this doesn't work.
why?
- skelly0
Is all of that script on the main timline?
- Fariska0
yep. Is this a problem?
(i was trying to avoid scripts inside the buttons/mc)
- fusionpixel0
you are close. follow my sample below:
mc.onRollOver = function() {
functionTrigger("hello");
}function functionTrigger(myVar){
this.myVar = myVar;
trace (myVar);
}
- Fariska0
Many thanks :-)
- davi-t0
if its on the main timeline, you can also turn ur function into a global function and not worry about having to try amd target it:
_global.myFunctionName=function...