VS2022简单操作_Debug_Warning&Error

Operate

在VS2022上编写C语言

  1. 创建新项目
  2. 空项目C++、Windows、控制台
  3. 下一步
  4. 将解决方案和项目放在同一目录中,勾不勾选都无所谓,个人习惯是不勾选,因为文件结构会好看一点
  5. 创建
  6. 右击源文件、添加、新建项
  7. 点击C++文件、更改名称,后缀改为.c
  8. 编写代码
  9. CTRL + F5 运行代码

字体

工具、选项、字体和颜色、字体:Consolas,大小:14

常用快捷键

组合快捷键功能
常用
shift + 方向键选中文本
ctrl + c可以不选中文本,直接复制该行
ctrl + x可以不选中文本,直接剪切该行
ctrl + k + c注释选中代码段
ctrl + k + u取消注释选中代码段
不常用
ctrl + 方向键移动视角
ctrl + 鼠标滚轮调整字体大小
Home和End将光标移至所在行的首部和末尾

添加文件

在学习文件操作时可能会用到

源文件、添加、现有项,选择txt文件(txt文件和.c文件最好是在同一文件夹中)

右键txt文件,选择打开方式,可以选择是文本编辑器还是二进制编辑器

选择二进制编辑器后,发现文件开头有8个0,正常,不需要管

其他

  1. 选中EOF或size_t,右键,速览定义,可以查看相关代码
  2. 输入 ctrl + z 可以停止运行代码
#include <stdio.h>
int main()
{
	int ch = 0;
	while ((ch = getchar()) != EOF)
	{
		putchar(ch);
	}
	return 0;
}

Debug

调试(英语:Debug)是发现和减少计算机程序、软件或软体系统中程序错误的一个过程。

在VS2022中调试代码

按 F10 或 F11 进入调试模式
在这里插入图片描述
左侧出现箭头
在这里插入图片描述
每按一次 F10 或 F11,箭头下移一行,表示程序运行完一行代码

逐语句(F11)和逐过程(F10)的区别

当调试遇到函数时,逐语句会进入函数内部然后再逐行调试,逐过程会直接执行此函数,得到函数运行结果。

在这里插入图片描述
逐语句进入函数内部
在这里插入图片描述
逐过程直接执行该函数
在这里插入图片描述

注意箭头位置和运行窗口结果

调试过程中查看其他信息

查看变量的值

进入调试

调试、窗口、监视、监视1(1)

调试、窗口、自动窗口/局部变量
在这里插入图片描述
在添加要监视的项中输入你要查看信息的那个变量名
在这里插入图片描述
也可以查看该变量的地址
在这里插入图片描述
局部变量和自动窗口,和监视窗口功能也差不多,只是不能指定要查看的变量,都是由系统自动生成的

查看地址在这里插入图片描述

查看该地址及其之后地址的信息,在名称后加逗号,再加一个数在这里插入图片描述

查看内存

在这里插入图片描述

断点调试

按 F9,光标所在行,代码区左侧会出现红圆
在这里插入图片描述
或者将鼠标移至代码区左侧,出现灰圆,点击在这里插入图片描述
按 F5,调试时会直接从断点处开始
在这里插入图片描述

再按 F5,会跳到下一个断点处
在这里插入图片描述
按 F9,或者点击红圆,取消断点

Warning & Error

scanf-error C4996

error C4996: ‘scanf’: This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
在这里插入图片描述

解决方法:

#define _CRT_SECURE_NO_WARNINGS

在这里插入图片描述

不是所有的控件路径都返回值-warning C4715

warning C4715: “cmp”: 不是所有的控件路径都返回值在这里插入图片描述
cmp函数没有考虑到全部情况

声明不能包含标签-E1072

在这里插入图片描述
在switch的某个case后立即定义某个变量就会弹出这个错误,但是好像没什么影响

解决方法可以是不在case后立即定义变量,或者是在case后加个大括号在这里插入图片描述

  • 26
    点赞
  • 29
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
This package contains 3 kid: 1. a book Developing Flex Applications 2. a web page viewer for doc88 ebt 3. a DDA downloader for doc88.com CONTENTS PART I: Presenting Flex CHAPTER 1: Introducing Flex. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 About Flex. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Developing applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Where to next. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 CHAPTER 2: Using MXML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 About MXML. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 The relationship between MXML and ActionScript classes. . . . . . . . . . . . . . . . . . 37 How MXML relates to standards. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 CHAPTER 3: Using ActionScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 About ActionScript. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Using ActionScript in Flex applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 CHAPTER 4: Developing Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 About the Flex coding process. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Working with a multitier application model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Controlling the appearance of an application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Enabling application zooming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Separating ActionScript from MXML. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 About the Flex development environment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Using Flex development tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Architecting an application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Improving application start-up time and performance. . . . . . . . . . . . . . . . . . . . . . 78 Summary of Flex application features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 4Contents PART II: Building User Interfaces to Flex Applications CHAPTER 5: Using Flex Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 About components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Class hierarchy for components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Using styles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Using behaviors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 Handling events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 Applying skins. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 Sizing components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 Changing the appearance of a component at runtime . . . . . . . . . . . . . . . . . . . . . . 99 Extending components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 CHAPTER 6: Using Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 About controls. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 Working with controls. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 Button control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 CheckBox control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 DateChooser. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 DateField control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 HRule and VRule controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 HSlider and VSlider controls. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 Label control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 Link control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 Loader control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 NumericStepper control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 ProgressBar control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 RadioButton control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 ScrollBar control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 Text control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 TextArea control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 TextInput control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 CHAPTER 7: Using Data Provider Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 About data providers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 ComboBox control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 DataGrid control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 List control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 Menu control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 MenuBar control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 Tree control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 Contents5 CHAPTER 8: Introducing Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 About containers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 Using containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 Controlling component sizing and positioning in a container. . . . . . . . . . . . . . . 246 Using scroll bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 Creating component instances at runtime. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 Configuring containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 CHAPTER 9: Using the Application Container . . . . . . . . . . . . . . . . . . . . . . . . . . 265 Using the Application container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265 Application container syntax. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268 Showing the download progress of an application . . . . . . . . . . . . . . . . . . . . . . . . 274 CHAPTER 10 : Using Layout Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 About layout containers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 Canvas layout container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280 Box layout container. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282 ControlBar layout container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284 DividedBox layout container. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 Form layout container. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 Grid layout container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 Panel layout container. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 Tile layout container. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 TitleWindow layout container. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317 CHAPTER 11 : Using Navigator Containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 About navigator containers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 ViewStack navigator container. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326 LinkBar navigator container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331 TabNavigator container. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 TabBar navigator container . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 Accordion navigator container. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343 CHAPTER 12 : Dynamically Repeating Controls and Containers . . . . . . . . . . . . 351 Using a Repeater object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351 Dynamically creating components based on data type. . . . . . . . . . . . . . . . . . . . . 359 How a Repeater object executes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360 CHAPTER 13 : Importing Images and Media . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361 Importing images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361 Controlling image importing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365 Using media controls. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370 6Contents PART III: Improving User Experience CHAPTER 14 : Building an Application with Multiple MXML Files . . . . . . . . . . . 383 About MXML components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383 Creating MXML components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385 Passing component references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390 Using interfaces. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 CHAPTER 15 : Working with ActionScript in Flex . . . . . . . . . . . . . . . . . . . . . . . . 393 Using ActionScript in Flex. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 Working with components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394 About scope. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398 Changing the appearance of a component at runtime . . . . . . . . . . . . . . . . . . . . . 407 Importing external resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408 Using the doLater() method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411 CHAPTER 16 : Using Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413 About events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413 Handling events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415 Handling mouse events. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431 Using base class events. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433 CHAPTER 17 : Creating ActionScript Components . . . . . . . . . . . . . . . . . . . . . . . 437 About ActionScript components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437 Defining custom user-interface components . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439 Passing data to a custom tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439 Defining events in ActionScript components. . . . . . . . . . . . . . . . . . . . . . . . . . . . 440 Adding ActionScript components to the Flex environment. . . . . . . . . . . . . . . . . 441 Defining nonvisual components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442 CHAPTER 18 : Creating Cell Renderers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447 Creating a cell renderer class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447 CHAPTER 19 : Using Styles, Fonts, and Themes . . . . . . . . . . . . . . . . . . . . . . . . 455 About styles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455 Using external style sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474 Using local style definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475 Using the StyleManager. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479 Using the setStyle() and getStyle() methods. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482 Using inline styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484 About fonts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485 Using themes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491 Skinning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494 Contents7 CHAPTER 20 : Using Behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497 Applying behaviors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497 Customizing an effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505 Defining a custom effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509 Defining and playing an effect in ActionScript . . . . . . . . . . . . . . . . . . . . . . . . . . 512 Using a custom effect trigger. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514 CHAPTER 21 : Using ToolTips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517 About ToolTips. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517 Using ToolTips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518 Using the ToolTipManager. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521 CHAPTER 22 : Using the Cursor Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525 About the Cursor Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525 Cursor Manager syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528 CHAPTER 23 : Using the Drag and Drop Manager . . . . . . . . . . . . . . . . . . . . . . . 531 About the Drag and Drop Manager. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531 Using a List, Tree, or DataGrid control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540 Drag and Drop Manager syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543 CHAPTER 24 : Using the History Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549 About history management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549 Using standard history management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549 Using custom history management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551 How the HistoryManager class saves and loads state . . . . . . . . . . . . . . . . . . . . . . 554 Using history management in a custom HTML file . . . . . . . . . . . . . . . . . . . . . . 555 CHAPTER 25 : Applying Deferred Instantiation . . . . . . . . . . . . . . . . . . . . . . . . . 557 About deferred instantiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557 Using deferred instantiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558 Manually instantiating controls. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562 Using the childDescriptors property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564 Starting applications incrementally . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567 CHAPTER 26 : Printing from SWF Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571 About Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571 Printing from the Flash Player context menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . 572 Using the ActionScript PrintJob class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573 Starting a print job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576 8Contents PART IV: Data Access and Interconnectivity CHAPTER 27 : Creating Accessible Applications . . . . . . . . . . . . . . . . . . . . . . . . 583 Accessibility overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583 About screen reader technology. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585 Configuring Flex applications for accessibility. . . . . . . . . . . . . . . . . . . . . . . . . . . 585 Using accessible components and managers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587 Creating tab order and reading order. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589 Accessibility for hearing-impaired users. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591 Testing accessible content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591 CHAPTER 28 : Managing Data in Flex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593 About Flex data management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593 Comparing Flex data management to other technologies. . . . . . . . . . . . . . . . . . . 597 CHAPTER 29 : Binding and Storing Data in Flex . . . . . . . . . . . . . . . . . . . . . . . . 601 Binding data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601 Using data models. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610 CHAPTER 30 : Validating Data in Flex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619 Validating data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619 Using standard validators. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628 CHAPTER 31 : Formatting Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639 Using formatters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639 Writing an error handler function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640 Using the standard formatters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640 Creating a custom formatter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651 CHAPTER 32 : Using Data Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655 About data services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656 Declaring a data service. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658 Calling a data service. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659 Handling data service results. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666 Using a service with binding, validation, and event handlers. . . . . . . . . . . . . . . . 669 Handling asynchronous calls to data services. . . . . . . . . . . . . . . . . . . . . . . . . . . . 671 Using callback URLs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 673 Generating debugging information for data services . . . . . . . . . . . . . . . . . . . . . . 674 Securing data services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675 Working with web services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682 Working with remote object services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688 Data service tag properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695 Data service whitelist tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700 Contents9 PART V: Advanced Application Development and Debugging CHAPTER 33 : Debugging Flex Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . 705 About debugging. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705 Enabling debug and warning messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706 Using the error-reporting mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707 Supported errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710 About the debugger. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712 Configuring the debugger. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714 Invoking the debugger. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715 Using the debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717 CHAPTER 34 : Profiling ActionScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729 About profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729 About the Profiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730 Using the Profiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730 Analyzing data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739 CHAPTER 35 : Using the Flex JSP Tag Library . . . . . . . . . . . . . . . . . . . . . . . . . 741 Introduction to the Flex JSP tag library. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741 Using the Flex JSP tag library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742 About the Flex tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742 Using the <mxml> tag. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 745 Using the <flash> tag. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 748 Using the <param> tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 748 PART VI: Administrating Applications CHAPTER 36 : Administering Flex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 753 Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 753 Using the command-line compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 754 Editing the flex-config.xml file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757 Changing application server settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767 Configuring logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 768 CHAPTER 37 : Applying Flex Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773 Flex security features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773 Flash Player security features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 775 Security concerns of an open format technology . . . . . . . . . . . . . . . . . . . . . . . . . 782 Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 783 10 Contents CHAPTER 38 : Deploying Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785 About deploying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785 Adding Flex to your application server. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786 Distributing components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791 Working with Flex files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793 About the HTML wrapper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 798 Passing request data to Flex applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805 Flash Player detection and deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 808 Managing Flash Player auto-update. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 812 PART VII: Custom Components CHAPTER 39 : Working with Flash MX 2004 . . . . . . . . . . . . . . . . . . . . . . . . . . 817 About creating components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 817 Working in the Flash environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 819 Working with component symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823 Exporting components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 828 CHAPTER 40 : Creating Basic Components in Flash MX 2004 . . . . . . . . . . . . 835 Creating simple components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835 Working with component properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 842 Binding properties to a custom component. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 843 Adding events to custom components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845 Setting default sizes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 849 Styling custom components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 850 Skinning custom components. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 851 Creating compound components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853 CHAPTER 41 : Creating Advanced Components in Flash MX 2004 . . . . . . . . . 857 Creating components overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 857 Writing the component’s ActionScript code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858 Skinning custom controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881 Adding styles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 882 Making components accessible . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 883 Improving component usability. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 883 Best practices when designing a component . . . . . . . . . . . . . . . . . . . . . . . . . . . . 884 ModalText.as example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 885 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 888 INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 891 PART I Presenting Flex This part describes the Macromedia Flex Presentation Server. These chapters introduce Flex, and the two languages that you use to develop Flex applications: MXML and ActionScript. This part also includes an introduction to building Flex applications. The following chapters are included:Chapter 1: Introducing Flex. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Chapter 2: Using MXML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Chapter 3: Using ActionScript. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Chapter 4: Developing Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 PART I

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值