Calendar

March 2007
M T W T F S S
« Feb   Apr »
 1234
567891011
12131415161718
19202122232425
262728293031  

Tag Cloud

Categories

Archives

Highest Rated

Most Viewed

Recent Posts

Recent Comments


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

Windowing with Apollo - full source code

By Rich Tretola | March 19, 2007Print This Post Print This Post
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...
204 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. private function createNewWindow():void{
  2. // create initOptions
  3. var initOptions:NativeWindowInitOptions  =  new NativeWindowInitOptions();
  4. initOptions.appearsInWindowMenu = true;
  5. initOptions.hasMenu = true;
  6. initOptions.resizable = winResizable.selectedItem;
  7. initOptions.systemChrome = NativeWindowSystemChrome.STANDARD;
  8. initOptions.transparent = winTransparent.selectedItem;
  9. // create windows
  10. var newWindow:NativeWindow = new NativeWindow( true, initOptions);
  11. newWindow.title = winTitle.text;
  12. newWindow.alwaysInFront = winAlwaysInFront.selectedItem;
  13. newWindow.stage.addChild( new VBox() );
  14. newWindow.width = winWidth.value;
  15. newWindow.height = winHeight.value;
  16. newWindow.x = winX.value;
  17. newWindow.y = winY.value;
  18. newWindow.addEventListener(flash.events.Event.CLOSE, closeEvent);
  19. // add new window to ArrayCollection
  20. windows.addItem(newWindow);
  21. winControlsEnabled = true;
  22. winY.value = windows.length * 50;
  23. }

Download the application

Download source code

Share/Save/Bookmark

Topics: Adobe AIR, Tutorials |

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

  1. 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!

  2. 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

  3. 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 [...]

  4. 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.) [...]

  5. 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?

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

    Yes, I believe that is an alpha bug.

Comments