simple flash q
- Started
- Last post
- 9 Responses
- de4k
How do I make script 'stick' to a button?
so that when I drag another instance of the button from the library, the script is already there.
Is this possible?
- imakedesign0
you could use this.
your_mc = function () {
this._alpha=0;
}
- de4k0
cheers imake.
but I'm just a dumbass illustrator.
do i stick this in the main timeline or with the btn?
(yes.. as dumb as that)
- Timson0
Put this on the main timeline.
myButton.onRelease = function () {
Make it doe something here
}Make sure the button you pull from the library's instancename is 'myButton'.
- imakedesign0
depends what version of AS you are coding in. AS2 Put it on frame one. using "this" just means you can reuse your code easily you are still going to have to give an instance name.
you could also look into attach movie. but it depends on what you are trying to do.
- de4k0
thanks guys.
- de4k0
more help please...
I need a button to tell a movie to go back 9 frames onRelease.
Not to frame 9, but to jump back 9 frames from the current frame.
this has to be easy.
I dont want to use labels.any help appreciated.
- stewart0
_currentframe -9
- de4k0
like this stew?
on (release) {
_root.holder_mc.play(currentfram... -9);
}
- UndoUndo0
put yr button in an mc and put yr as in the MC using this.myButton.onRelease = function(){
//do this
}drag the mc from the library and it makes no difference what you call it.