ACE

Calendar

March 2007
S M T W T F S
  1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

Tag Cloud

360Flex actionscript air air 2 android apple as3 books conference contest cookbook deeplinking Dreamweaver F3 v. F4 FileReference flash flash builder flashplayer Flash Player flashplayer10 Flex flex3 flex4 flexbuilder flickr fotobooth google gumbo ImageDropR indexing InsideRIA iphone java load() localconnection max max 2009 merapi microsoft mobile pixel bender save() SilverLight training updatemanager

Categories

Archives

Recent Posts

Recent Comments


« Create your first Apollo Window | Main | HTML Control »

Windowing with Apollo – full source code

By Rich Tretola | March 19, 2007
1,920 views

windowing.jpg

Windowing in Apollo is a very simple task.

The Windowing sample will demonstrate this by allowing you to set the preferences
of the new window by setting NativeWindow and NativeWindowInitOptions properties,
and then manage the windows by tracking them within a custom Array.

Creating a new window is as simple as this:

1
var newWindow:NativeWindow = new NativeWindow(true,new NativeWindowInitOptions());

The function that created the new windows in the Windowing sample looks like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
private function createNewWindow():void{
// create initOptions
var initOptions:NativeWindowInitOptions  =  new NativeWindowInitOptions();
initOptions.appearsInWindowMenu = true;
initOptions.hasMenu = true;
initOptions.resizable = winResizable.selectedItem;
initOptions.systemChrome = NativeWindowSystemChrome.STANDARD;
initOptions.transparent = winTransparent.selectedItem;
// create windows
var newWindow:NativeWindow = new NativeWindow( true, initOptions);
newWindow.title = winTitle.text;
newWindow.alwaysInFront = winAlwaysInFront.selectedItem;
newWindow.stage.addChild( new VBox() );
newWindow.width = winWidth.value;
newWindow.height = winHeight.value;
newWindow.x = winX.value;
newWindow.y = winY.value;
newWindow.addEventListener(flash.events.Event.CLOSE, closeEvent);
// add new window to ArrayCollection
windows.addItem(newWindow);
winControlsEnabled = true;
winY.value = windows.length * 50;
}

Download the application

Download source code

Topics: Adobe AIR, Tutorials | 6 Comments »

6 Responses to “Windowing with Apollo – full source code”

Ahmet Says:
March 19th, 2007 at 5:14 am

Well that the first Apollo app. I’ve tried so far. It work great for an alpha :D
I just had a windows alert and a memory read error at a moment but i couldn’t remake it.

Thanks for the source!

Reply to this comment

Oleg Says:
March 19th, 2007 at 5:25 am

Hi, nice app. You may reproduce error by trying to create transparent window. Windows XP/SP2

Reply to this comment

murat k.girgin » İlk Apollo Öğreticileri Says:
March 20th, 2007 at 3:32 am

[...] Başa bir uygulamayı Apollo ile pencere içine almak / Windowing [...]

Displaying ID3 info of mp3 file in a separate Window « FlexNotes Says:
March 28th, 2007 at 12:07 am

[...] (Hint: Follow Rich Tretola’s Windowing with Apollo tutorial.) [...]

byGui Says:
April 4th, 2007 at 7:00 am

Hi, nice example, I don’t know if you have notice but the property nativeWindow.alwaysInFront doesn’t seems to do anything. Is this something that doesn’t work in the alpha version of apollo?

Reply to this comment

everythingflex Says:
April 4th, 2007 at 7:06 am

Yes, I believe that is an alpha bug.

Reply to this comment

Comments



You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser