[ Pobierz całość w formacie PDF ] .The List Objects command does not list all ActionScript data objects.In this context, an object isconsidered to be a shape or symbol on the Stage.To display a list of objects in a movie:1 If your movie is not running in test mode, select Control > Test Movie.2 Select Debug > List Objects.A list of all the objects currently on the Stage is displayed in the Output panel, as shown inthis example:Level #0: Frame=1 Label="Scene_1"Button: Target="_level0.myButton"Shape:Movie Clip: Frame=1 Target="_level0.myMovieClip"Shape:Edit Text: Target="_level0.myTextField" Text="This is sample text."Using the Output panel 77Listing a SWF file s variablesIn test mode, the List Variables command displays a list of all the variables currently in the SWFfile.This is especially useful for finding the correct variable target path and variable name.Unlikethe Debugger, the list does not update automatically as the SWF file plays; you must select theList Variables command each time you want to send the information to the Output panel.The List Variables command also displays global variables declared with the _global identifier.The global variables are displayed at the top of the List Variables output in a Global Variablessection, and each variable is prefixed with _global.In addition, the List Variables command displays getter/setter properties properties that arecreated with the Object.addProperty() method and invoke get or set methods.A getter/setter property is displayed alongside any other properties in the object it belongs to.To makethese properties easily distinguishable from ordinary variables, the value of a getter/setter propertyis prefixed with the string [getter/setter].The value displayed for a getter/setter property isdetermined by evaluating the get function of the property.To display a list of variables in a SWF file:1 If your SWF file is not running in test mode, select Control > Test Movie.2 Select Debug > List Variables.A list of all the variables currently in the SWF file is displayed in the Output panel, as shown inthis example:Global Variables:Variable _global.MyGlobalArray = [object #1] [0:1,1:2,2:3]Level #0:Variable _level0.$version = "WIN 6,0,0,101"Variable _level0.RegularVariable = "Gary"Variable _level0.AnObject = [object #1] {MyProperty: [getter/setter] 3.14159}Displaying text field properties for debuggingTo get debugging information about TextField objects, you can use the Debug > List Variablescommand in test movie mode.The Output panel uses the following conventions in displayingTextField objects:" If a property is not found on the object, it is not displayed." No more than four properties are displayed on a line." A property with a string value is displayed on a separate line." If there are any other properties defined for the object after the built-in properties areprocessed, they are added to the display using the rules in the second and third points above." Color properties are displayed as hexadecimal numbers (0x00FF00)." The properties are displayed in the following order: variable, text, htmlText, html,textWidth, textHeight, maxChars, borderColor, backgroundColor, textColor, border,background, wordWrap, password, multiline, selectable, scroll, hscroll, maxscroll,maxhscroll, bottomScroll, type, embedFonts, restrict, length, tabIndex, autoSize.78 Chapter 3: Writing and Debugging ScriptsThe Debug > List Objects command in test mode lists TextField objects.If an instance name isspecified for a text field, the Output panel displays the full target path including the instancename in the following form:Target = "target path"Using the trace statementWhen you use the trace statement in a script, you can send information to the Output panel.For example, while testing a movie or scene, you can send specific programming notes to thepanel or have specific results appear when a button is pressed or a frame is played.The tracestatement is similar to the JavaScript alert statement.When you use the trace statement in a script, you can use expressions as parameters.The valueof an expression is displayed in the Output panel in test mode, as shown here:The trace statement returns values that appear in the Output panel.onClipEvent(enterFrame){trace("onClipEvent enterFrame " + enterFrame++)}Updating Flash Player for testingYou can download the latest version of Flash Player from the Macromedia Support Center atwww.macromedia.com/support/flash and use it to test your SWF files with the most recentversion of Flash Player.Updating Flash Player for testing 7980 Chapter 3: Writing and Debugging ScriptsPART IIHandling Events and Creating InteractionEvents can be user-generated, such as mouse clicks or keypresses, or can occur as a result of someother process, such as an XML file loading over the network.The first chapter in this partdescribes the different types of events in Macromedia Flash and discusses how to handle them inActionScript
[ Pobierz całość w formacie PDF ] zanotowane.pldoc.pisz.plpdf.pisz.plmikr.xlx.pl
|