Sie sind auf Seite 1von 5

1.

The default property is the MXML tag property that is implicit for content in
side of the MXML tag if you do not explicitly specify a property.
For a ComboBox, the default property is the dataProvider property.
<!-- Omit the default property. -->
<mx:ComboBox>
<mx:ArrayCollection>
<mx:String>AK</mx:String>
<mx:String>AL</mx:String>
<mx:String>AR</mx:String>
</mx:ArrayCollection>
</mx:ComboBox>
<!-- Explicitly speficy the default property. -->
<mx:ComboBox>
<mx:dataProvider>
<mx:ArrayCollection>
<mx:String>AK</mx:String>
<mx:String>AL</mx:String>
<mx:String>AR</mx:String>
</mx:ArrayCollection>
</mx:dataProvider>
</mx:ComboBox>
Not all Flex components define a default property.
2. Do not use the backslash character (\) as a separator in the path to an appli
cation asset. You should always use a forward slash character (/) as the separat
or.
3. For properties of type String, you can insert a newline character in the Stri
ng in two ways:
* By inserting the &#13; code in your String value in MXML
* By inserting "\n" in an ActionScript String variable used to initialize th
e MXML property
4. [Bindable] metadata tag before the property definition. This metadata tag spe
cifies that the myText property can be used as the source of a data binding expr
ession. Data binding automatically copies the value of a source property of one
object to the destination property of another object at run time when the source
property changes.
5. You can also get a reference to a component when you have a String that match
es the name. To access an object on the application, you use the this keyword, f
ollowed by square brackets, with the String inside the square brackets. The resu
lt is a reference to the objects whose name matches the String.
The following example changes style properties on each Button control using a co
mpound String to get a reference to the object:
<?xml version="1.0"?>
<!-- usingas/FlexComponents.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script><![CDATA[
private var newFontStyle:String;
private var newFontSize:int;
public function changeLabel(s:String):void {
s = "myButton" + s;
if (this[s].getStyle("fontStyle")=="normal") {
newFontStyle = "italic";
newFontSize = 18;
} else {
newFontStyle = "normal";
newFontSize = 10;
}
this[s].setStyle("fontStyle",newFontStyle);
this[s].setStyle("fontSize",newFontSize);
}
]]></mx:Script>
<mx:Button id="myButton1"
click="changeLabel('2')"
label="Change Other Button's Styles"
/>
<mx:Button id="myButton2"
click="changeLabel('1')"
label="Change Other Button's Styles"
/>
</mx:Application>
6. Flex includes an Application.application property that you can use to access
the root application. You can also use the parentDocument property to access the
next level up in the document chain of a Flex application, or the parentApplica
tion property to access the next level up in the application chain when one Appl
ication object uses a SWFLoader component to load another Application object.
If you write ActionScript in a component's event listener, the scope is not the
component but rather the application.
7. There are two ways to include an external ActionScript file in your Flex appl
ication:
* The source attribute of the <mx:Script> tag. This is the preferred method
for including external ActionScript class files.
* The include statement inside <mx:Script> blocks.
8. The include directive supports only relative paths
9. You can use the include only where multiple statements are allowed.
10. The AIR Debug Launcher (ADL), adl.exe, is in the bin directory of your Flex
SDK installation. (There is no separate Java version).
11. Flex AIR applications are contained within the MXML WindowedApplication tag.
The MXML WindowedApplication tag creates a simple window that includes basic wi
ndow controls such as a title bar and close button.
12. There are two window containers: the ApplicationWindow, a substitute for the
Application container to use as the main or initial window of an AIR applicatio
n; and the Window, for application windows that are opened after the initial win
dow of the application.
13. To assign a FlexNativeMenu component as the context menu for a visual Flex c
ontrol, call the FlexNativeMenu instance's setContextMenu() method, passing the
visual control as the component parameter (the only parameter):
menu.setContextMenu(someComponent);
14. Before setting the dockIconMenu or systemTrayIconMenu property you may want
to determine whether the user's operating system supports a dock icon or a syste
m tray icon, using the NativeApplication class's static supportsDockIcon and sup
portsSystemTrayIcon properties.
15. The FlexNativeMenu class uses the methods of the IMenuDataDescriptor interfa
ce to access and manipulate information in the data provider that defines the me
nu behavior and contents. Flex includes the DefaultDataDescriptor class that imp
lements this interface. A FlexNativeMenu control uses the DefaultDataDescriptor
class if you do not specify another class in the dataDescriptor property.
16. systemChrome cannot be set to standard when either transparent is true or ty
pe is lightweight.
17. When the lightweight type is used, systemChrome must be set to none.
18. By default, the background of an MXML window is opaque, even if you create t
he window as transparent.
19. o turn off the default background displayed for HTML content, set the paints
DefaultBackground property to false.
20. To create an HTML window, either use the HTMLLoader createRootWindow() metho
d or, from an HTML document, call the JavaScript window.open() method.
21. The desktop window is not created until you call the window open() method.
22. alwaysInFront property

Specifies whether the window will be displayed in the top-most group of windows.
In almost all cases false is the best setting. Changing the value from false to
true will bring the window to the front of all windows (but will not activate it
). Changing the value from true to false will order the window behind windows re
maining in the top-most group, but still in front of other windows. Setting the
property to its current value for a window will not change the window display or
der.
23. activate()

Brings the window to the front (along with making the window visible and assigni
ng focus).
24. If the Nativeapplication.autoExit property is true, which is the default, th
en the application exits when its last window closes.
25. If the Nativeapplication.autoExit property is true, which is the default, th
en the application exits when its last window closes.
26. Application menus are supported on Mac OS X, but not on Windows.
27. Window menus are supported on the Windows operating system, but not on Mac O
S X. Native menus can only be used with windows that have system chrome.
28. An AIR pop-up menu is like a context menu, but is not necessarily associated
with a particular application object or component. Pop-up menus can be displaye
d anywhere in a window by calling the display() method of any NativeMenu object.
29. NativeMenu and NativeMenuItem objects both dispatch displaying and select ev
ents:
30. On Mac OS X, the default modifier is the command key (Keyboard.COMMAND). On
Windows, it is the control key (Keyboard.CONTROL).
31. To assign different modifier keys, assign a new array containing the desired
key codes to the keyEquivalentModifiers property.
32. Thus, to use "r" as the mnemonic for a menu item labeled, "Format," you woul
d set the mnemonicIndex property equal to 2.
33. To prevent the default menu from opening, listen for the contextmenu event a
nd call the event object's preventDefault() method:
34. NativeMenu

NativeMenuEvent.DISPLAYING
NativeMenuEvent.SELECT (propagated from child items and submenus)
NativeMenuItem

NativeMenuEvent.SELECT
NativeMenuEvent.DISPLAYING (propagated from parent menu)
ContextMenu

ContextMenuEvent.MENU_SELECT
ContextMenuItem

ContextMenuEvent.MENU_ITEM_SELECT
NativeMenu.SELECT
35. AIR provides an interface for interacting with the application task bar icon
through the NativeApplication.nativeApplication.icon property.
36. On Windows, you can highlight the window taskbar button by calling the notif
yUser() method of the NativeWindow instance. The type parameter passed to the me
thod determines the urgency of the notification:
* NotificationType.CRITICAL: the window icon flashes until the user brings t
he window to the foreground.
* NotificationType.INFORMATIONAL: the window icon highlights by changing col
or.
37. Note that in this example, the value of overwrite parameter of the copyTo()
method (the second parameter) is set to true. By setting this to true, an existi
ng target file is overwritten. This parameter is optional. If you set it to fals
e (the default value), the operation dispatches an IOErrorEvent event if the tar
get file already exists (and the file is not copied).
38. With the drag-and-drop API, you can allow a user to drag data between applic
ations and between components within an application. Supported transfer formats
include:
* Bitmaps
* Files
* HTML-formatted text
* Text
* URLs
* Serialized objects
* Object references (only valid within the originating application)
39. The event handler can inspect the event object to determine whether the drag
ged data is available in a format that the target accepts and, if so, let the us
er drop the data onto it by calling the NativeDragManager.acceptDrop() method.
40. Whether you call the open() method or the openAsync() method to create a new
database, the database file's name can be any valid file name, with any file ex
tension. If you call the open() or openAsync() method with null for
the reference parameter, a new in-memory database is created rather than a datab
ase file on disk.
41. The horizontalCenter and verticalCenter styles specify distance between the
component's center point and the container's center, in the specified direction;
a negative number moves the component left or up from the center.
42. Do not specify a top or bottom style with a verticalCenter style; the vertic
alCenter value overrides the other properties. Similarly, do not specify a left
or right style with a horizontalCenter style.
43. If you also specify a center constraint (horizontalCenter or verticalCenter)
, the size of the component is calculated from the edge constraints and its posi
tion is determined by the center constraint value.
44. Content size (default) means that the space allocated to the region is dicta
ted by the size of the child objects in that space. As the size of the content c
hanges, so does the size of the region. Content sizing is the default when you d
o not specify either fixed or percentage sizing parameters.
45. RPc-no polling in services config. messaging-Polling enabled.
46. To send the message, the Producer first creates an instance of the AsyncMess
age class and then sets its body property to the message. Then, it calls the Pro
ducer.send() method to send it. To receive messages, the Consumer first calls th
e Consumer.subscribe() method to subscribe to messages sent to a specific destin
ation.
47. ADD MODE-Lightening dissolve, SUBTRACT-Darkening dissolve
48. selectData.parameters[":param1"] = 25;
49. function resultHandler(event:SQLEvent):void
{
var result:SQLResult = selectStmt.getResult();
var numResults:int = result.data.length;
for (var i:int = 0; i < numResults; i++)
{
var row:Object = result.data[i];
var output:String = "itemId: " + row.itemId;
output += "; itemName: " + row.itemName;
output += "; price: " + row.price;
trace(output);
}
}
50. In any case, the SQLResult instance has a property, lastInsertRowID, that co
ntains the row identifier of the most-recently inserted row if the executed SQL
statement is an INSERT statement.
51. Use the SQLConnection.attach() method to open a connection to an additional
database on a SQLConnection instance that already has an open database.
52. For example, when the lastResult property is set to e4x, you would use {srv.
lastResult.product}; when the lastResult property is set to object, you would us
e {srv.lastResult.products.product}.
53. Validators use the following two properties to specify the item to validate:
Source,property
54. The order of precedence for style properties, from first to last, is as foll
ows:
Inline
Class selector
Type selectors (most immediate class takes precedence when multiple selectors ap
ply the same style property)
Ancestor class's type selector
Parent chain (inheriting styles only)
global selector
If you later call the setStyle() method on a component instance, that method tak
es precedence over all style settings, including inline.
Style definitions in <mx:Style> tags, external style sheets, and the defaults.cs
s style sheet follow an order of precedence. The same style definition in defaul
ts.css is overridden by an external style sheet that is specified by an <mx:Styl
e source="stylesheet
55. repeatCount=0...play effect indefinitely.

Blend Modes

Das könnte Ihnen auch gefallen