What are all the different types of returntypes? And what is a returntype/ return returntype?
What are all the different types of returntypes? And what is a returntype/ return returntype?
Is it possible to define a function on _root, and then refer to it on a movieClip?
Because I have a code to fade out music:
function fadeOut(sound:String,frames:Number,vol:Number):Void{
vols = vol
onEnterFrame = function(){
if(vol>0){
vol -= (vols/frames);
}
_root[sound].setVolume(vol);
if(vol == 0){
_root[sound].stop();
}
}
}
music=new Sound();
music.attachSound("song");
music.start(0,0);
fadeOut("music",500,100);
The layout of this being: fadeOut(path,number of frames taken to fade out, volume faded out from);
Of course, I will need to run this code from lots of movieClips, is this possible? I assume it is, but I just want to check.
At 5/29/08 09:32 AM, Hoeloe wrote: Is it possible to define a function on _root, and then refer to it on a movieClip?
Yes. Just try actually testing it out. :)
At 5/29/08 10:05 AM, souled wrote:At 5/29/08 09:32 AM, Hoeloe wrote: Is it possible to define a function on _root, and then refer to it on a movieClip?Yes. Just try actually testing it out. :)
I did. Didn't work D:
Tried:
fadeOut("mus",500,100);
fadeOut("_root.mus",500,100);
_root.fadeOut("_root.mus",500,100);
fadeOut("mus",500,100);
None worked. I'll try again.
At 5/29/08 10:19 AM, Hoeloe wrote:At 5/29/08 10:05 AM, souled wrote:I did. Didn't work D:At 5/29/08 09:32 AM, Hoeloe wrote: Is it possible to define a function on _root, and then refer to it on a movieClip?Yes. Just try actually testing it out. :)
Tried:
fadeOut("mus",500,100);
fadeOut("_root.mus",500,100);
_root.fadeOut("_root.mus",500,100);
_root.fadeOut("mus",500,100);
None worked. I'll try again.
Hold on: _root.fadeOut("mus",500,100); works now.
This is my first time using these function things so I'm a little shaky on them, I think I'm getting the hang of it now though.