Podstrony
- Strona startowa
- Martin T. Bannister Department of the Treasury Blueprint for Actions (2009)
- Sandemo Margit Saga o Czarnoksiazniku Tom 1
- Griffin Laura Tracers 01 Nie do wykrycia
- ARONSON&WILSON&AKERT Psychologia Społeczna
- Bialolecka Ewa Tkacz Iluzji (2)
- Microsoft Press Microsoft Encyclopedia of Security
- Summits. Six meetings that shap Dav
- linuxadm (8)
- Powell Tag & Judith Panowanie nad umysłem
- Kelly Cathy Sekrety z przeszłoÂści
- zanotowane.pl
- doc.pisz.pl
- pdf.pisz.pl
- slaveofficial.htw.pl
[ Pobierz całość w formacie PDF ]
.Use Key.getCode() to retrieveinformation about the last key pressed." keyUp The action is initiated when a key is released.Use the Key.getCode() method toretrieve information about the last key pressed." data The action is initiated when data is received in a loadVariables() or loadMovie()action.When specified with a loadVariables() action, the data event occurs only once,when the last variable is loaded.When specified with a loadMovie() action, the data eventoccurs repeatedly, as each section of data is retrieved.DescriptionEvent handler; triggers actions defined for a specific instance of a movie clip.ExampleThe following statement includes the script from an external file when the SWF file is exported;the actions in the included script are run when the movie clip they are attached to loads:onClipEvent(load) {#include "myScript.as"}584 Chapter 12: ActionScript DictionaryThe following example uses onClipEvent() with the keyDown movie event.The keyDown movieevent is usually used in conjunction with one or more methods and properties of the Key object.The following script uses Key.getCode() to find out which key the user has pressed; if thepressed key matches the Key.RIGHT property, the movie is sent to the next frame; if the pressedkey matches the Key.LEFT property, the movie is sent to the previous frame.onClipEvent(keyDown) {if (Key.getCode() == Key.RIGHT) {_parent.nextFrame();} else if (Key.getCode() == Key.LEFT){_parent.prevFrame();}}The following example uses onClipEvent() with the mouseMove movie event.The _xmouse and_ymouse properties track the position of the mouse each time the mouse moves.onClipEvent(mouseMove) {stageX=_root._xmouse;stageY=_root._ymouse;}See alsoKey class, MovieClip._xmouse, MovieClip._ymouse, on(), updateAfterEvent()onUpdateAvailabilityFlash Player 6.Usagefunction onUpdate() {.statements.;}ParametersNone.ReturnsNothing.DescriptionEvent handler; onUpdate is defined for a Live Preview movie used with a component.When aninstance of a component on the Stage has a Live Preview movie, the authoring tool invokes theLive Preview movie s onUpdate function whenever the component parameters of the componentinstance change.The onUpdate function is invoked by the authoring tool with no parameters,and its return value is ignored.The onUpdate function should be declared on the main Timelineof the Live Preview movie.Defining an onUpdate function in a Live Preview movie is optional.For more information on Live Preview movies, see Using Components.onUpdate 585ExampleThe onUpdate function gives the Live Preview movie an opportunity to update its visualappearance to match the new values of the component parameters.When the user changes aparameter value in the components Property inspector or Component Parameters panel,onUpdate is invoked.The onUpdate function will do something to update itself.For instance, ifthe component includes a color parameter, the onUpdate function might alter the color of amovie clip inside the Live Preview to reflect the new parameter value.In addition, it might storethe new color in an internal variable.Here is an example of using the onUpdate function to pass parameter values through an emptymovie clip in the Live Preview movie.Suppose you have a labeled button component with avariable labelColor, which specifies the color of the text label color.The following code is in thefirst frame of the main Timeline of the component movie://Define the textColor parameter variable to specify the color of the buttonlabel text.buttonLabel.textColor = labelColor;In the Live Preview movie, place an empty movie clip named xch in the Live Preview movie.Then place the following code in the first frame of the Live Preview movie.Add xch to thelabelColor variable path, to pass the variable through the my_mc movie clip://Write an onUpdate function, adding "my_mc." to the parameter variable names:function onUpdate (){buttonLabel.textColor = my_mc.labelColor;}orAvailabilityFlash 4.This operator has been deprecated in favor of the || (logical OR) operator.Usagecondition1 or condition2Parameterscondition1,2 An expression that evaluates to true or false.ReturnsNothing.DescriptionOperator; evaluates condition1 and condition2, and if either expression is true, then thewhole expression is true.See also|| (logical OR), | (bitwise OR)586 Chapter 12: ActionScript DictionaryordAvailabilityFlash Player 4.This function has been deprecated in favor of the methods and properties of theString class.Usageord(character)Parameterscharacter The character to convert to an ASCII code number.ReturnsNothing.DescriptionString function; converts characters to ASCII code numbers.See alsoString class_parentAvailabilityFlash Player 5.Usage_parent.property_parent._parent.propertyDescriptionIdentifier; specifies or returns a reference to the movie clip or object that contains the currentmovie clip or object
[ Pobierz całość w formacie PDF ]