PDA

Просмотр полной версии : AIR:добавления содержимого в новое окно


Pow R. Toc H.
12.09.2007, 03:09
Вот код приложения:
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" applicationComplete="createNativeWindow();">
<mx:Script>
<![CDATA[
import mx.controls.Button;
import flash.display.Stage;

public function createNativeWindow():void{
//create the init options
var options:NativeWindowInitOptions = new NativeWindowInitOptions();
options.transparent = false;
options.systemChrome = NativeWindowSystemChrome.STANDARD;
options.type = NativeWindowType.NORMAL;
//create the window
var newWindow:NativeWindow = new NativeWindow(false,options);
newWindow.width = 600;
newWindow.height = 400;
//add a sprite to the window
newWindow.stage.align = StageAlign.TOP_LEFT;
newWindow.stage.scaleMode = StageScaleMode.NO_SCALE;
//show the new window
var bt:Button = new Button();
newWindow.stage.addChild(bt);
newWindow.visible = true;
}
]]>
</mx:Script>
</mx:WindowedApplication>

однако ничего в новом окно не добавляется.. Интересно что в примере из документации со sprite всё работает.

etc
12.09.2007, 10:03
Вопросы по AIR лучше задавать в разделе Flex, т.к. это практически одно и то же.

DarkLight
12.09.2007, 19:01
Ну выделено же в хелпе...
Important: Adding Flex components directly to the display list of an application-created window is not supported in this Beta release of AIR. You can add Flex components to the display list of the initial window automatically created on application start up, but not to the display lists of any windows created by your application logic. You can load a Flex-based SWF into a new window as long as the SWF is loaded into its own ApplicationDomain.



P. S.
Вопросы по AIR лучше задавать в разделе Flex, т.к. это практически одно и то же.
Ну это если на флексе проект, все-таки AIR апдейт для Flash тоже есть.