How to initialize controls' eventHandler in a TabNavigator?

Like following script, the btnA is null when iniMe is
invoked.
<?xml version="1.0"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
xmlns:ns1="ctls.*" initialize="iniMe();">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
function iniMe(){
if (btnA==null) mx.controls.Alert.show("btnA is null!");
btnc.addEventListener("click",myFunc);
function myFunc(event:Event):void{
mx.controls.Alert.show("clicked");
]]>
</mx:Script>
<mx:TabNavigator x="64" y="71" width="200" height="200"
>
<mx:Canvas id="canvasA" label="tabA" width="100%"
height="100%">
<mx:Button id="btnA" x="42" y="77" label="ButtonA"/>
</mx:Canvas>
</mx:TabNavigator>
</mx:Application>
How do i add eventHandler to btnA using ActionScript? ( Not
in mxml)
thanks.

First, try using the creationComplete event instead of
initialize.
Tracy

Similar Messages

  • How can I control a LabView VI using a C++ script/program?

    Hi,
    I am a developer of a satellite communications system that is being used in
    a satellite project I am working on at the University of Colorado - Boulder.
    The project is called 3CS. We have built a simple LabView program that uses
    some of the server routines to transfer data via TCP/IP protocol. The basic
    VI initializes the radio hardware at the site the satellite is currently
    over and then opens a data stream. The data is then downloaded back to our
    servers via secure VPN. My question is this: How can I control a VI using
    a language like C++ to execute certain parts of the VI. I basically have a
    VI that listens for radio packets. My program then strips off the satellite
    radio ID and protocol information
    . I need to get this information into the
    VI remotely through a C++ script. Any help would be greatly appreciated.
    Sincerely,
    Ryan R. Fligg
    Colorado Space Grant College
    Electrical and Computer Engineering
    University of Colorado - Boulder

    Hello fellow Boulderite,
    The easiest way would probably be to use the application builder to create a DLL from the VI. The other option is to use the LabVIEW ActiveX interface. There are some examples of using C++ to control LabVIEW in the example library of the NI Developer Zone.

  • How can I control the node execution sequence?

    I have invoked several nodes for controls which are to "Reinit To Dflt". How can I control the sequence of there initialization?

    to ensure code (any code) is going to execute in the order you want, you can use some error cluster to controll data flow, so you need your individual code in a subVI with error in and out. Another posibility is to use sequences, but most people will say they hide code, so you can use one sequence only, and pass dummy data from one to another to ensure data flow.
    Hope this helps

  • How can I control the music that plays during Apple TV photo slide shows?

    I don't want to make my parents listen to Breaking Benjamin music as they watch my photo slide shows on Apple TV. Need something more sedate. But if a B.B. song is in my iTunes music library, it is a candidate for random selection as background music for my slide shows. How do I control what music plays during Apple TV photo slide shows?

    What I find is really silly, is the fact the music video's are listed under that artists albums in the Music menu. And when you go into the video 'album' (called 'Unknown' unless you change it) there is an option to shuffle the tracks. Clicking this just results in an error message. So, they should either remove that option if it is a video album, or, better yet, GET IT TO WORK. So silly of them to omit this.
    I have submitted feedback.

  • How can I control selection on a PDF

    I have Acrobat Pro 9 Pro build 9.4.6 and am constantly exporting documents from indesign to .pdf, and also building docs in the 'combine' feature from mixed pages. 
    While everything seems to go reasonably well, I have a few problems that are due either to my ignorance, or bugs.
    1.  The biggie; How can I control what I select, for the purpose of copying, moving and deleting?   When I drag the touch-up object tool over my selection, it selects what it wants to most of the time; sometimes it selects (i.e., puts a light blue box around) the entire page, instead of my selection (no pages are scanned).  There are very few instances when I get exactly what I want; there are usually a few lines above or below, no matter how careful I am in my selection.  The funny thing is that this is not a constant; sometimes, the tool works perfectly!  and I have my heart in my mouth every time I really need it to work, hoping that it will not force me to go back to Indesign to make minor corrections.   Perhaps my problems are connected to options I select when exporting my indds, but I've tried checking, clearing, and selecting various combinations and nothing seems to work.
    Sometimes, the text selection tool is strange; a wide blue swath develops over the selected text, even though it is still usually possible to  edit the text in this condition.  And BTW, is there anything to do about the fact that some text can't be edited at all because a suitable font replacement can't be found?  Can't a font be added somehow that will take care of this?
    2. Headers and Footers; fairly effortless, but if the footer contains two rows and I want them centered, the second row looks centered in the preview but not in the doc.  I have to go back to the footer dialog and guesstimate how many spaces to place before the second row to get it to look centered.  Also, is there any way to place a logo in a header?  That would be one of my requests for the next version of Acrobat, if not.
    3.Hyperlinks; they don't always work,even though I check Hyperlinks in the Export settings.  Sometimes yes, sometimes no.
    4.  Typwriter toolbar; it also seems to offer font and size changes whenever it feels like it, and I've tried all different orders of typing, selecting, etc.

    It's me again, sorry!  I wanted to save what I'd written, and my message popped up to the board.
    Thank you for any advice anyone has!
    PS  My indd and acrobat are the same version, as they came in the same package (CS4).  Windows XP sp3.
    Oh, one more thing I just remembered, as long as I'm complaining; sometimes if I place an object (the logo) and copy it to another page, it disappears on the original page, as if I've cut it.  Any fix for that?  (strange how I can edit tmy 'reply' but not my original post...well, at least I found where to ask a question fairly quickly!)

  • How can I control SMTP server list in Mail?

    I've seen a lot of discussion about e.g. deleting servers, but it often includes smug replies like "click the delete button" when there is often no such button. I have found a possible 'get around' to this particular problem by changing the server data to something that doesn't exist, save that, then select the server again from the list and hey presto, there is now a Delete button you can use. But again, that is not the full story because if that server is used as the primary server for any other account, you cannot modify the data.
    Not only that, but you CANNOT simply swap servers so that e.g. an account uses one of the other servers as its primary server. Unless I'm missing something major here, it is NOT possible to move servers. You can change the data for the server to be exactly the same as another server, but that just means you now have an identical duplicate. Once a server entry has been created, it is an independent data entity.
    So I seem to have several problems here.
    1. A server cannot be deleted if it's in use as a primary for any account.
    2. Servers cannot be moved, i.e. swapped between 'Primary' and 'Other'
    3. Simply editing the server data does not 'merge' it with any other entry that may have the exact same data.
    4. When creating an account, you cannot pick the outgoing SMTP server from the list of ones already created. Simply entering the same data as one that already exists may use that existing server, but may create a new duplicate. I have seen both of these occur and once there's a duplicate, you cannot get rid of it.
    I want 3 accounts to all use the same 'Primary' server and also have the same 'Other' server. IOW, only 2 actual servers. After the first 2 accounts are created, that's what I have. Somehow they seem to be able to 'share' the same servers. But when I create the third account and enter the same data for its SMTP server as the others use as their primary (i.e. exactly the same process as when creating the second account), for some reason it does NOT use the existing matching server and I now get a third server created. I simply cannot get around this since whatever I do, each of the duplicates is used as a primary and so cannot be deleted. If I could swap them around so that the third account was using another account as its primary, then I could delete the duplicate and all would be well, but as pointed out above, that's not possible.
    I'm hoping that I'm simply wrong about all this and it is actually possible to do what I currently believe it impossible. Can anyone explain how to actually control this server list?

    can't edit SMTP server list in Mail
    i have exactly the same problem using 10.9.4 - did you ever get a reply?

  • How can I control the zoom on my mac mouse?

    How can I control the zoom function on my mouse? In the middle of working on things my hand will rub the mouse by accident and all of a sudden the context within the screen is large. I have no idea of how to work this feature on my mouse and most times to get it to return to normal, I have to escape out of the work I am performing.

    If you are pressing the "Control" button on the Mac keyboard, scrolling up will zoom in and scrolling down will zoom out. You can disable this if it annoys you through System Preferences > Universal Access. If you are using Mountain Lion, it would be System Preferences > Accessibility.
    Uncheck the in the "Seeing" or "Zoom" section that says "Use scroll gesture with modifier keys to zoom".  It may be slightly different if you have an older OS X version. I have Mountain Lion and am going off of memory on the older versions.

  • I have multiple email accounts on my iPad. How do I control the order in which the accounts are displayed?

    I have multiple email accounts on my iPad. How do I control the order in which the accounts are displayed?

    In landscape mode, the mailbox list is automatically displayed (in portrait mode, you will need to tap the button to,show it).
    To edit the list, tap edit as shown below.

  • How can I control a button from one swf file to another swf file?

    Hi,
    I have a main.swf file. From that file I am accessing the external.swf file which is an external file.
    Now, how can I write code on my main.swf file for the button which is on my external.swf file?
    Activities.MainPanel.close_btn.addEventListener(MouseEvent.CLICK, btnClickClose);
    Activities.MainPanel.close_btn (This buttons is actually on external.swf file, but I want to write code on main.swf file to execute it on external.swf) how can I control one swf button on other swf file?
    Thanks.

    Here's some example code that you should be able to adapt to your needs.
    // create a new loader object instance...
    var loader:Loader = new Loader();
    // make the download request...
    var request:URLRequest = new URLRequest("external.swf");
    // add a complete event listener to the loader
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
    // start the actual loading process...
    loader.load(request);
    // create a new empty movieClip instance, you will put the loaded movie into this movieClip once its loaded
    var externalMovie:MovieClip;
    // this function is called when the download has finished and the file is ready to use...
    function completeHandler(event:Event):void {
       // set the contents of the loaded movie to the new empty movieClip...
               externalMovie = MovieClip(event.target.content);
       // add this new movie to the display list...
       addChild(externalMovie);
    Now you can refer to the loaded movie with the instance name "externalMovie". So if, for instance, you want to address a button in the loaded movie, you could write something like this on the main timeline:
    externalMovie.addEventListener(MouseEvent.CLICK, btnClickClose);
    function btnClickClose(event:MouseEvent):void {

  • How can i control what images load on my project to save preload time and avoid loading all images, elements, divs not yet visible?

    Sup buddies,
    How can I control what images load on my project to save preload time and avoid loading all images, elements, divs not yet visible?
    As the project grows in size the load time increases. How does one control not loading all images ,divs,elements etc. until they're
    needed on the timeline? For example some sections are off and only become visible when recalled. My projects slowly grow in size so loading
    all images , is counter productive . My other option would be to create separate htmls but that breaks the seamless user experience .
    TY...Over N Out... 

    hello, kiwi
    quote: "Is there an easy way to burn a completed project to DVD, but keep only the (lo res, lo size) previews on my hard drive?"
    yes.
    maybe,...
    1. you might think of making DVD backups first prior to importing the photos into Aperture. "Store Files: In their current location" once in Aperture make low rez Previews, and export finished Project.
    or,
    2. bring in the photographs to hard drive first prior to importing the photos into Aperture. "Store Files: In their current location" once in Aperture make low rez Previews, and export finished Project.
    the low rez Previews will stay in Aperture but the high quality Versions will be exported onto DVDs and gone from the hard drive (if you delete the originals).
    another way would be to export small about 50-70 pixel wide high quality jpegs to a folder on your Desktop and import & keep these in Aperture Library as a reference. make metadata to show where the original Project DVDs are stored and DVD filing system used.
    victor

  • How do I control a data log session with period and sample time?

    I need a data logging system where the operator can select 2 logging parameters: Log Period and Sample Time. I also need a START and STOP button to control the logging session. For example, set the log period for 1 hour and the sampling time for 1 second. (I may be using the wrong jargon here.) In this case when the START button is clicked, the system starts logging for 1 second. An hour later, it logs data for another second, and so on until the operator clicks the STOP button. (I will also include a time limit so the logging session will automatically stop after a certain amount of time has elapsed.)
    It’s important that when the STOP button is clicked, that the system promptly stops logging. I cannot have the operator wait for up to an hour.
    Note that a logging session could last for several days. The application here involves a ship towing a barge at sea where they want to monitor and data log tow line tension. While the system is logging, I need the graph X-axis (autoscaled) to show the date and time. (I’m having trouble getting the graph to show the correct date and time.) For this application, I also need the system to promptly start data logging at a continuous high rate during alarm conditions.
    Of course I need to archive the data and retrieve it later for analysis. I think this part I can handle.
    Please make a recommendation for program control and provide sample code if you can. It’s the program control concepts that I think I mostly need help here. I also wish to use the Strip Chart Update Mode so the operator can easily view the entire logging session.
    DAQ Hardware: Not Selected Yet
    LabVIEW Version: 6.1 (Feel free to recommend a v7 solution because I need to soon get it anyway.)
    Operating System: Win 2000
    In summary:
    How do I control a graphing (data log) session for both period and sample time?
    How do I stop the session without having to wait for the period to end?
    How do I automatically interrupt and control a session during alarm conditions?
    Does it make a difference if there is more than one graph (or chart) involved where there are variable sample rates?
    Thanks,
    Dave

    Hello Dave,
    Sounds like you have quite the system to set up here. It doesn�t look like you are doing anything terribly complicated. You should be able to modify different examples for the different parts of your application. Examples are always the best place to start.
    For analog input, the �Cont Acq&Chart (buffered).vi� example is a great place to start. You can set the scan rate (scans/second) and how many different input channels you want to acquire. This example has its own stop button; it should be a simple matter to add a manual start button. To manually set how long the application runs, you could add a 100 ms delay to each iteration of the while loop (recommended anyway to allow processor to multi-task) and add a control that sets the number
    of iterations of the while loop.
    For logging data, a great example is the �Cont Acq to File (binary).vi� example.
    For different sample rate for different input lines, you could use two parallel loops both running the first example mentioned above. The data would not be able to be displayed on the same graph, however.
    If you have more specific questions about any of the different parts of your application, let me know and I�ll b happy to look further into it.
    Have a nice day!
    Robert M
    Applications Engineer
    National Instruments
    Robert Mortensen
    Software Engineer
    National Instruments

  • How can I control how many times an individual photo is shown?

    How can I control the frequency of each photo on apple tv?

    Welcome to the Apple Community.
    Photos in slideshows will only be showed once until the slideshow repeats. If you want it to show more than once you will need to duplicate it.
    Photos in screensavers show randomly.

  • How can I control an iPad from a touch screen which is mirroring the iPad screen

    How can I control an iPad from a touch screen which is mirroring the iPad screen.
    This is a very important application for disability students who wish to use iPad apps but do not have sufficient fine motor skills to use the small screen of an iPad but could use a large format display touch screen.
    There must be a way.?????????? Help!!
    Peter Niass
    [email protected]

    Have a look here
    http://www.macstories.net/iphone/the-external-touchscreen-that-can-control-an-ip hone/

  • How can I control my fan speed?

    How can I control my fan speed on my macbook pro? I use SMC for gaming and streaming video from the internet when using my Mac OS, but I partitioned my drive and installed Windows 8 in order to play a different game (not a huge game) and the computer heats up dramatically when playing on Windows through Boot Camp to the point that it freezes every time (it never does this when playing a mac game or streaming on the normal partition Mac OS).
    Any suggestions or programs to control fan speed of the mac from windows?

    Get a cooling pad.  That will much better than trying to constantly adjust fan speeds.
    Ciao.

  • How can i control my mini mac with my ipad on diferent wifi networks?

    How can i control my mini mac with my ipad on diferent wifi networks?

    Go to my pc, splashtop, team viewer or any of the several remote desktop apps in the store.

Maybe you are looking for

  • ADE crashes every time I try to return a borrowed item

    Here is the error detail: Description:   Stopped working Problem signature:   Problem Event Name:          APPCRASH   Application Name:          DigitalEditions.exe   Application Version:          3.0.0.0   Application Timestamp:          52b0ff73  

  • Bonjour service disabled after latest update

    I just updated my iTunes to the latest version and a message came up stating: Warning! The Bonjour Service has been disabled. Bonjour is required for sharing music with others, playing music through AirPlay speakers, connecting to Apple TV...."  then

  • Directory object on $APPLCSF/$APPLOUT

    Hi, My requirement is to fetch a xml file from concurrent program output directory $APPLCSF/$APPLOUT and update some tables based on it. In order to read the file I need to have a directory object created on the same. Can I create a directory object

  • [..\..\Src\Win\WinPathUtils.cpp-427] error?????

    I am running Adobe Production bundle CS3 and in Encore when I try to import an asset this message window appres "Adobe Encore has encountered an error [..\..\Src\Win\WinPathUtils.cpp-427]" and then I click the "continue button" and this pops up "An i

  • Two problems of illustrator cc

    I really wanna ask some problems in illustrator CC. I have two questions. First, Why i can't move a rectangle with 0.1 pixel as a unit? there is no problem with other shapes. Just Rectangle. Even smart guide didn't work. Second, there is a crash whic