Jump to content

Programming


AnonymousX

Recommended Posts

I'm newer to flash and creating flash buttons. I recently have attempted to make a flash button in which, on a rollover, it plays a short sequence. While there is no mouse over, I want the button to sit idle. I can't seem to make it do both. I can either program it and it will sit and do nothing, or program it so that it continuously flashes. Is what I'm doing possible? Or am I maybe just approaching it wrong?

Link to comment
Share on other sites

read it, maybe it gives you some idea, any wonders tell me :)ActionScript 2.0 Language Reference ActionScript language elements > Global Functions > on handler on handleron(mouseEvent:Object) {// your statements here}Specifies the mouse event or keypress that triggers an action. Availability: ActionScript 1.0; Flash Player 2 - Flash 2. Not all events are supported in Flash 2.ParametersmouseEvent:Object - A mouseEvent is a trigger called an event . When the event occurs, the statements following it within curly braces ({ }) execute. Any of the following values can be specified for the mouseEvent parameter: press The mouse button is pressed while the pointer is over the button. release The mouse button is released while the pointer is over the button. releaseOutside While the pointer is over the button, the mouse button is pressed and then rolls outside the button area just before it is released. Both the press and the dragOut events always precede a releaseOutside event. rollOut The pointer rolls outside the button area. rollOver The mouse pointer rolls over the button. dragOut While the pointer is over the button, the mouse button is pressed and then rolls outside the button area. dragOver While the pointer is over the button, the mouse button has been pressed, then rolled outside the button, and then rolled back over the button. keyPress "<key> " The specified keyboard key is pressed. For the key portion of the parameter, specify a key constant, as shown in the code hinting in the Actions Panel. You can use this parameter to intercept a key press, that is, to override any built-in behavior for the specified key. The button can be anywhere in your application, on or off the Stage. One limitation of this technique is that you can't apply the on() handler at runtime; you must do it at authoring time. Make sure that you select Control > Disable Keyboard Shortcuts, or certain keys with built-in behavior won't be overridden when you test the application using Control > Test Movie. For a list of key constants, see the Key class.ExampleIn the following script, the startDrag() function executes when the mouse is pressed, and the conditional script is executed when the mouse is released and the object is dropped:on (press) { startDrag(this);}on (release) { trace("X:"+this._x); trace("Y:"+this._y); stopDrag();}

Link to comment
Share on other sites

read it, maybe it gives you some idea, any wonders tell me :)ActionScript 2.0 Language Reference ActionScript language elements > Global Functions > on handler on handleron(mouseEvent:Object) {// your statements here}Specifies the mouse event or keypress that triggers an action. Availability: ActionScript 1.0; Flash Player 2 - Flash 2. Not all events are supported in Flash 2.ParametersmouseEvent:Object - A mouseEvent is a trigger called an event . When the event occurs, the statements following it within curly braces ({ }) execute. Any of the following values can be specified for the mouseEvent parameter: press The mouse button is pressed while the pointer is over the button. release The mouse button is released while the pointer is over the button. releaseOutside While the pointer is over the button, the mouse button is pressed and then rolls outside the button area just before it is released. Both the press and the dragOut events always precede a releaseOutside event. rollOut The pointer rolls outside the button area. rollOver The mouse pointer rolls over the button. dragOut While the pointer is over the button, the mouse button is pressed and then rolls outside the button area. dragOver While the pointer is over the button, the mouse button has been pressed, then rolled outside the button, and then rolled back over the button. keyPress "<key> " The specified keyboard key is pressed. For the key portion of the parameter, specify a key constant, as shown in the code hinting in the Actions Panel. You can use this parameter to intercept a key press, that is, to override any built-in behavior for the specified key. The button can be anywhere in your application, on or off the Stage. One limitation of this technique is that you can't apply the on() handler at runtime; you must do it at authoring time. Make sure that you select Control > Disable Keyboard Shortcuts, or certain keys with built-in behavior won't be overridden when you test the application using Control > Test Movie. For a list of key constants, see the Key class.ExampleIn the following script, the startDrag() function executes when the mouse is pressed, and the conditional script is executed when the mouse is released and the object is dropped:on (press) { startDrag(this);}on (release) { trace("X:"+this._x); trace("Y:"+this._y); stopDrag();}
Thats an extreamly good description. Did you write that>??
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...