Wednesday 29 September 2010

Flash Action Scipt

Hey guys,

Here is some action script. You can just copy paste these codes into Flash. The only thing you'll need to make sure is that you're using action script 2.0 instead of 3.0. You can change the action script settings under File somewhere...

If you do decide to use 2.0, you won't be able to use bones. Might be worth looking into 3.0 if your final idea will need bones!


Button:

on (release) { gotoAndPlay(*);
}


* = frame number you want button to link to. For example: gotoAndPlay(2); will make the button go to frame 2.



stop(); - put this in the frame to stop it from playing. Your timeline should have a little letter 'a' in the place you've put this action.



Drag and Drop. In a Movie Clip (might work for Graphic too), put this code:

on (press) { startDrag("");
}
on (release) { stopDrag();
}


I'm sorry I'm not so great at explaining this stuff (I'm actually pretty terrible at explaining anything...) but I'm happy to help people out if they need it. You might be better off finding some kind of tutorial though since I only really know my way around older versions of Flash!

1 comment:

  1. Thanks Amy :) I shall use these!
    I sorted out the gun animation, with some help from Rhys. I shall try and post it on here soon!

    ReplyDelete