How to put a fx:component(native_window) into a separate file

Hello, fans of flex

I want to know how I can put the fx:component - tag in a separate file. Here is my code:

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                            xmlns:s="library://ns.adobe.com/flex/spark" 
                            xmlns:mx="library://ns.adobe.com/flex/mx">
     <fx:Script>
          <![CDATA[
               import mx.controls.Alert;
               import mx.events.FlexEvent;
               
               private var newWindow:MyNativeWindow;
               public var house:String = "wooden house";
               private static var _app:NativeWindow2;
     
               private function openNewWindow():void {
                    if (newWindow != null) newWindow.close();
                    newWindow = new MyNativeWindow();
                    newWindow.width = 200;
                    newWindow.height = 200;                    

                    try 
                    {                         
                         newWindow.open();
                    } 
                    catch (err:Error) 
                    {               
                         trace(err.message);
                    }
               }

               
          ]]>
     </fx:Script>    
     
     <fx:Declarations>
          <fx:Component className="MyNativeWindow">
               <mx:Window horizontalAlign="center" verticalAlign="middle" backgroundColor="blue">
                    <fx:Script>
                         <![CDATA[
                              import mx.core.FlexGlobals;
                              
                              
                              protected function button1_clickHandler(event:MouseEvent):void
                              {
                                   import mx.core.FlexGlobals;
                                   
                                   trace(mx.core.FlexGlobals.topLevelApplication.house);
                                   
                              }                              
                         ]]>
                    </fx:Script>
                    <mx:Button label="Yeah" click="button1_clickHandler(event)" />
                    <mx:Button label="close" click="this.close()"/>                    
               </mx:Window>
          </fx:Component>    
     </fx:Declarations>     
     
     <s:VGroup horizontalCenter="0" top="10">
          <s:Button label="Open New Window" color="black" click="openNewWindow()"/>
     </s:VGroup>
</s:WindowedApplication>

What about the King

flexx0r

create new MXML component name MyNativeWindow

and paste it in your code




     
          
     
     
     


your application code would then become


http://ns.adobe.com/mxml/2009"
                            xmlns:s="library://ns.adobe.com/flex/spark"
                            xmlns:mx="library://ns.adobe.com/flex/mx">
     
          
         

     
          

     
          
     


Tags: Flex

Similar Questions

  • How can I get the Windows Fax and Scan program to scan mutiple page to a file rather than to each page into a separate file?

    How can I get the Windows Fax and Scan program to scan mutiple page to a file rather than to each page into a separate file?

    You don't, so use the scanning software provided by your device manufacturer, assuming that you have installed the unknown device with their installation cd or the download direct the full version of this site to the

  • How to put more than 100 acquisitions to "write text file.vi?

    Hello

    I work with labview for about a week and I need help.

    I use the "write to text file.vi" in one of my screws and now I've discovered, that the number of acquisitions in this VI seems to be limited to 100.
    but I need a larger number (around 10,000). So I need to know how to increase the number.

    If you need more information, tell me and I've got the poster!

    THX
    Fr33k

    Propably the control's properties from the beach.

    Right-click on the control and select Properties. Then go to the tab of the range.

    Felix

  • OfficejetPro 5800: How to scan a document multi-page into single pdf file?

    Recently, I switched from Windows XP to Mac OS x 10.9. I installed the software OSX version for my OfficejetPro 8500/909 a printer. The only way to analysis seems to be scanned in jpeg format. I have not found a way to scan a document of several pages in a single pdf file. Can someone tell me if this is possible at all?  Thank you!

    Hi Thomoos, I can certainly help you with that.

    You can open the analysis option in system preferences and analyze the many elements from there.

    1. Place the item you want to scan on the scanner glass, or load in the ADF (ADF) documents, if your printer has one.
  • How can I save 2 pages (on a 165 page document) into a separate file?

    I have downloaded a PDF 165 page file to the cloud of document, open the document and then attempted to use the Organizer to extract the 2 pages of the document to be saved in a separate file.  However, I can't use the Pages feature organize because I get a conversion failure - too many Pages.  Apparently, there's a max of 100 pages?  When I subscribed to this service, there never any mention on a limit on the documents page.  Is there a way I can save these pages in a separate file?

    Hi terryl88847428,

    You must have the Acrobat Application (Adobe Acrobat free trial downloadversion |) Acrobat Pro DC) installed on your computer to use the Extract function.

    Please see this KB for help. Acrobat Help. Rotate, move, delete and renumber PDF pages.

    Kind regards

    Nicos

  • How can I take a file with individual letters and save each of them into a separate file?

    I have a file which has 55 letters to the people in it and I want to save each page as a separate file under the name of the person.  Can I do this?

    Yes, with Acrobat.

  • How to split a large video file into several episodes/files?

    Hi all

    I have a 52 minute video I need to divide into 3 separate files until I can modify it (so I can download it on youtube as 3 separate episodes). I know how to separate the layers and make all make the base edition etcetera, but I'm stumped on how to turn those divide the layers into separate files.

    Any help on this is much appreciated.

    Thanks in advance

    If you split just a video using Premiere Pro or The Adobe Media Encoder directly. You will save a lot of time. In the SOUL, you can set a duration for the three segments. In Premiere Pro just create three sequences and add them to the render tail. It's really basic things. You should study upward.

  • How to put the split clips separately?

    I use first Elements 9 for Mac. I can divide the clips very well, but how to record clips newly created into a separate file? I want to use them in a different project. I want to also these small clips stand individually on my area of working space in case I decide to reposition in a place later in the film.

    I've renamed the clip on the timeline bar successfully, but it does not appear in a separate file in my workspace or anywhere on my hard drive. I also tried to copy and paste, but after it copies, there is no option to paste. I tried to drag and drop to the area of space of work/video clip, but he refused.

    Help please!

    Welcome to the forum.

    After your cut, you can then share (to the required file format) and the WAB (work area bar) allows you to limit this sharing (Export).

    Good luck

    Hunt

  • How to put restrictions into the laptop using the domain?

    Hey! I want to know how to put the restriction in my laptop using the domain. While I may restrict the use of the USB into my laptop?

    Can U help with this.
    Kaifi Asif

    I am not sure that the use of a domain is specific to the type of restriction being attempted.

    A pindrive is usually a USB type device that is inserted into your local system. With this ability, or other devices can be inserted and used. Areas tend to assign all of your computer to a specific network, usually hosted by your company or the cloud. Areas rarely restrict the use of the material.

    For material restrictions, your company or other provider will usually deploy a security product for your local device. It can be configured to prevent the use of the spindle-disks, external hard drives or other types of media that allow the storage and retrieval of information; all by allowing the use of devices without storage type (types of wireless keyboard/mouse).

    Of course, Windows 7 allows you to join a working group and which allows sharing data from other systems, but is not a network "domain." Those are centrally managed by network/firewall servers and network administrators.

    If the device is a personal device, then there are products that can be purchased allowing the locking of the external media storage devices; they run at first upward and once installed, don't allow external storage devices to use once it is uninstalled. All this happens in the background.

    There is however a very radical measure, and this is to turn off the USB port at the hardware level. This however, would prevent ANY type of USB device to work in this port. This type of restriction is probably is not the right course of action.

    I hope this helps...

    Good luck!

  • HP Officejet Pro X476dw (nextworked-Windows 7 Pro) how to scan multiple pages into a single file?

    Does anyone know how to scan multiple pages into a single jpegfile?

    When you scan a document of several pages in a file on a network each page gets its own jpeg image scanend file.

    HP standalone scanner allow generally allows you to add the multuple scans in a jpeg file.

    Any help much appreciated!

    Thank you

    Joihn

    Hello

    Well, I don't know how you can read many jpeg files into a SINGLE file. Put scanned images in a folder is a logical way to keep them in one place. From my understanding single jpeg image may be a ONE page document, but many jpeg images cannot be concatinated to be a multiple page document. We can use images, software publishing to put them in a single document, but still only one page (each image is smaller). Using pdf output, you can concatenate/merge a lot of images in a sinlge multi-page file.

    Kind regards.

  • How can I combine several photos that have been scanned into a single file

    I have a lot of photos that have been scanned, and each image is a file.  How can I combine them into a single file

    Hello

    If stored in your pictures folder

    Right-click and select new folder

    Name the folder (ex: vacation in Taos, NM)

    Press CTRL and start on the left by clicking on the photos you want to put in the folder

    Left click and hold the first photo

    Drag the photo in the newly named folder

    All the Photos you selected will immediately return in the folder

    Working with the pictures in the folder

    http://Windows.Microsoft.com/en-us/Windows-Vista/working-with-the-pictures-folder

    If you wish, you can drag the folder out photos folder in Documents folder

    Moving and copying files using the drag-and - move

    http://Windows.Microsoft.com/en-us/Windows-Vista/moving-and-copying-files-by-using-the-drag-and-drop-method

  • How to put a site on my desktop shortcut

    How to put a shortcut to the site on my desktop, Vista, I used to just right click and save to the desktop but with Windows 7 when I do the same thing, he saves an icon on my desktop but a folder as well and when I click on the shortcut icon, I have to return to the web page , but I can't open anything upwards from there and then go back and delete the shortcut.

    Here, this can help. Go to the web page that you would like the shortcut to. Copy the address into the address bar in your web browser. Go to your desktop and click right then stationary on 'new' and then select pase now to "shortcut" the shortcut (Ctrl + V) and click on 'next' label your click shortcutand "Finish."

    Hope that helped,

    Weston

  • Moving files: I am wanting to put the existing files to a new folder, how do I create a new folder and move those file to the new folder?

    I am wanting to put the existing files to a new folder, how do I create a new folder and move those file to the new folder?

    I am wanting to put the existing files to a new folder, how do I create a new folder and move those file to the new folder?

    Hello

    Go t the location where you want to create the new folder, right-click and select new/folder. Name the folder.

    Go to where the files, select the files and then use the right mouse button to drag the files into the new folder. When you drop the file, a pop-up menu, select the Move option.

    Let us know if you have any other questions.

    Thank you for using Windows 7

    Ronnie Vernon MVP
  • Can someone tell me please how to fix programs icon who turned into VLC player? I really need your help guys as soon as possible...

    Can someone tell me please how to fix programs icon who turned into VLC player? I really need your help guys as soon as possible...

    From what you have stated above, I think that the file association for LNK files has been given misdirection to the VLC Player. I've seen this happen when opening a program via a shortcut (for example. LNK file), you are asked what type of program to open it with. After selecting the VLC Player (or another program) via the Select a program from a list of programs installedand check always use the selected program to open this type of file (circled in red below), the document or program referenced by the shortcut of origin opens in VLC Player as it should.

    The problem is that now all shortcuts (for example. LNK files) on the desktop or in the browser will want to be opened by VLC Player and VLC Player icon to view the shortcut no matter what shortcut was originally intentioned to open. This is known as a file association and the default icon. The same condition can occur if you have performed these actions 'Open with' on one. JPG or even a. EXE, but the. LNK explanation is much more likely for the items on the desktop.

    The good news is that a small free utility was written to cancel the. LNK file association was created. There is also a registry hack to achieve, but I recommend the utility unAssoc for its ease of use. I used to send people on another site to download this utility, but this site has become confused with all the ads and fake download links. I put a copy on own OneDrive here.

    Just download, then use the utility to unassociate the. LNK files for the user or globally delete the file type and let windows rebuild a new default.

  • How to put internet explorer in my desktop?

    Have a ultrabook with windows newHP brand 8 - have the icon of internet explore on my desk and then want to be able to open multiple windows.  How to put internet explorer in my desktop?

    On the forum, there is a similar question, but it is said to go into the menu start and then open all programs (where is it?) and then right on internet explore and then move the slider to send to (where is it?) and create a shortcut on the desktop (don't know how)

    Any help much appreciated

    There are several ways, but it's easier:

    Open the charm to search for and type Internet Explorer. Now, right click on the result and choose "PIN to the taskbar" in the app bar that will appear at the bottom of the screen.

Maybe you are looking for

  • CAN´t activate Ipad 2 after update

    I have can´t activate my Ipad 2 after the last day, because for some reason any I reach the activation of the can´t server. And if I try to start in itunes on my computer, so I can see the ipad in the Solution Explorer, but it dosen´t start in itunes

  • How can I update to El Capitan

    I have 10.10.5 on my MacBook Pro. I downloaded Combo 10.11.2 from Apple's site, but it install it; Guest says I need 10.11, but it doesn't seem to be available.  I went back and did the software update, and it is now downloading 10.11.3.  If it not i

  • How can I change Vista business connect multiple?

    When idle for a few minutes, Vista Business calls again for a log in.  How can I change that so I don't have to keep connected?

  • "Windows 7 Build 7601 this copy of Windows is not genuine" after several teething problems

    Well, a few days ago, I had repeated problems where after my machine has started, things were not running right.  Several programs that start automatically at startup were suspended, others were not run at all and I had to reboot several times in a r

  • Can I dynamically add string to goMenuItem destination?

    In my managedbean, I build the menu with a list of goMenuItem action. Each goMenuItem has a different destination.When the user clicks on the goMenuItem, I want to be able to add additional information to the destination URL and to open the URL in a